Vim documentation: vital/Vim/WindowLayout

main help file
vital-window-layout.txt               window layout library.

Maintainer: kamichidu <c.kamunagi at gmail com>

==============================================================================
CONTENTS                                Vital.Vim.WindowLayout-contents

INTRODUCTION                    Vital.Vim.WindowLayout-introduction
INTERFACE                       Vital.Vim.WindowLayout-interface
  Functions                       Vital.Vim.WindowLayout-functions
  Objects                         Vital.Vim.WindowLayout-objects
ENGINES                         Vital.Vim.WindowLayout-engines

==============================================================================
INTRODUCTION                            Vital.Vim.WindowLayout-introduction

Vital.Vim.WindowLayout is a window layout library. It provides useful way to
lay out your plugin's layout.


        let s:V = vital#{plugin-name}#new()
        let s:WL = s:V.import("Vim.WindowLayout")

        " Create a new layout object
        let s:layout = s:WL.new()

        " lays out a current tabpage
        call s:layout.apply(
        \ [
        \   {'id': 'hoge', 'bufname': 'HOGE'},
        \   {'id': 'fuga', 'bufname': 'FUGA'},
        \   {'id': 'piyo', 'bufname': 'PIYO'},
        \ ],
        \ {
        \   'layout': 'border',
        \   'north':  {'bufref': 'hoge', 'height': 0.5, 'walias': 'one'},
        \   'center': {'bufref': 'fuga', 'width':  100, 'walias': 'two'},
        \   'east':   {
        \     'layout': 'border',
        \     'north':  {'bufref': 'piyo', 'height': 0.333, 'walias': 'three'},
        \     'center': {'bufref': 'piyo', 'height': 0.333, 'walias': 'four'},
        \     'south':  {'bufref': 'piyo', 'height': 0.333, 'walias': 'five'},
        \   },
        \ }
        \)
        " to be shown layouted tabpage like below
        "
        " +--------------------------+
        " |                          |
        " |                          |
        " |                          |
        " |                          |
        " |                          |
        " +------------+-------------+
        " |            |             |
        " |            +-------------+
        " |            |             |
        " |            +-------------+
        " |            |             |
        " +------------+-------------+


==============================================================================
INTERFACE                               Vital.Vim.WindowLayout-interface
------------------------------------------------------------------------------
FUNCTIONS                               Vital.Vim.WindowLayout-functions

new()                                   Vital.Vim.WindowLayout.new()
        Creates a Layout object. (Vital.Vim.WindowLayout-Layout)

==============================================================================
OBJECTS                                 Vital.Vim.WindowLayout-objects

------------------------------------------------------------------------------
Layout Object                           Vital.Vim.WindowLayout-Layout

A Layout object has following members:

Layout.apply({buffers}, {layoutdata})   Vital.Vim.WindowLayout.apply()
        Lays out the current tabpage using {buffers} and {layoutdata}.
        {buffers} argument is for specifying buffers that are managed this
        module. {layoutdata} argument is for specifying layout options.

        {buffers} is a List of Dictionary (buffer definition). It has
        several attributes below:

        id (required)
                A buffer id will be referenced in {layoutdata}.

        bufname
                A new buffer name.
                (Default: '')

        range
                Same to Vital.Vim.BufferManager-config-range.

        bufnr
                A buffer number will be placed.
                If you give this attribute, Vital.Vim.WindowLayout will not
                create new buffer.

        initializer
                It's Funcref or List.
                It will be used for buffer initialization when a buffer
                created.
                Vital.Vim.WindowLayout calls given Funcref with no argument.
                When initializer is a List, Vital.Vim.WindowLayout calls
                first element (Funcref) with second argument (Dictionary).

        {layoutdata} is a Dictionary (layout definition). It has several
        attributes is used by Vital.Vim.WindowLayout-engines for layout
        window and opening its buffer. see below:

        layout (required)
                Indicates a layout engine.
                See Vital.Vim.WindowLayout-engines for more details.

        bufref
                Specify buffer id (see {buffers} id attribute). It will open
                specified buffer on its window.

        walias
                An alias of its window. It is for
                Vital.Vim.WindowLayout.winnr().

Layout.winnr({walias})                  Vital.Vim.WindowLayout.winnr()
        Gets a window number by given {walias}. It returns a window number if
        found it, otherwise returns -1.
        You want to use this function, you have to specify walias attribute
        for Vital.Vim.WindowLayout.apply() function.

==============================================================================
ENGINES                                 Vital.Vim.WindowLayout-engines

Currently supported some engines, listed below:

BorderLayout    `border'
        See Vital.Vim.WindowLayout.BorderLayout.

FlowLayout      `flow'
        See Vital.Vim.WindowLayout.FlowLayout.

GridLayout      `grid'
        See Vital.Vim.WindowLayout.GridLayout.

==============================================================================
vim:tw=78:fo=tcq2mM:ts=8:ft=help:norl

top - main help file - tag index