-
Notifications
You must be signed in to change notification settings - Fork 64
/
WindowLayout.txt
147 lines (116 loc) · 4.55 KB
/
WindowLayout.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
*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