comparison runtime/doc/tabpage.txt @ 1118:2b8ff9e3c520

updated for version 7.1a
author vimboss
date Sat, 05 May 2007 17:10:09 +0000
parents 4bac29d27e2f
children 2de44d8f2cf1
comparison
equal deleted inserted replaced
1117:a13e4b242735 1118:2b8ff9e3c520
1 *tabpage.txt* For Vim version 7.0. Last change: 2006 May 02 1 *tabpage.txt* For Vim version 7.1a. Last change: 2007 Mar 11
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
72 {not available when the |+file_in_path| feature was disabled 72 {not available when the |+file_in_path| feature was disabled
73 at compile time} 73 at compile time}
74 74
75 :[count]tab {cmd} *:tab* 75 :[count]tab {cmd} *:tab*
76 Execute {cmd} and when it opens a new window open a new tab 76 Execute {cmd} and when it opens a new window open a new tab
77 page instead. Doesn't work for |:diffsplit| or |:diffpatch|. 77 page instead. Doesn't work for |:diffsplit|, |:diffpatch|,
78 |:execute| and |:normal|.
78 When [count] is omitted the tab page appears after the current 79 When [count] is omitted the tab page appears after the current
79 one. When [count] is specified the new tab page comes after 80 one. When [count] is specified the new tab page comes after
80 tab page [count]. Use ":0tab cmd" to get the new tab page as 81 tab page [count]. Use ":0tab cmd" to get the new tab page as
81 the first one. Examples: > 82 the first one. Examples: >
82 :tab split " opens current buffer in new tab page 83 :tab split " opens current buffer in new tab page
127 Using the mouse: If the tab page line is displayed you can click in a tab page 128 Using the mouse: If the tab page line is displayed you can click in a tab page
128 label to switch to that tab page. Click where there is no label to go to the 129 label to switch to that tab page. Click where there is no label to go to the
129 next tab page. |'tabline'| 130 next tab page. |'tabline'|
130 131
131 :tabn[ext] *:tabn* *:tabnext* *gt* 132 :tabn[ext] *:tabn* *:tabnext* *gt*
132 gt *CTRL-<PageDown>* *<C-PageDown>* 133 <C-PageDown> *CTRL-<PageDown>* *<C-PageDown>*
133 <C-PageDown> *i_CTRL-<PageDown>* *i_<C-PageDown>* 134 gt *i_CTRL-<PageDown>* *i_<C-PageDown>*
134 Go to the next tab page. Wraps around from the last to the 135 Go to the next tab page. Wraps around from the last to the
135 first one. 136 first one.
136 137
137 :tabn[ext] {count} *CTRL-<PageUp>* *<C-PageUp>* 138 :tabn[ext] {count}
138 {count}gt *i_CTRL-<PageUp>* *i_<C-PageUp>* 139 {count}<C-PageDown>
139 <C-PageUp> Go to tab page {count}. The first tab page has number one. 140 {count}gt Go to tab page {count}. The first tab page has number one.
140 141
141 142
142 :tabp[revious] *:tabp* *:tabprevious* *gT* 143 :tabp[revious] *:tabp* *:tabprevious* *gT* *:tabN*
143 :tabN[ext] *:tabN* *:tabNext* 144 :tabN[ext] *:tabNext* *CTRL-<PageUp>*
145 <C-PageUp> *<C-PageUp>* *i_CTRL-<PageUp>* *i_<C-PageUp>*
144 gT Go to the previous tab page. Wraps around from the first one 146 gT Go to the previous tab page. Wraps around from the first one
145 to the last one. 147 to the last one.
146 148
147 :tabp[revious] {count} 149 :tabp[revious] {count}
148 :tabN[ext] {count} 150 :tabN[ext] {count}
151 {count}<C-PageUp>
149 {count}gT Go {count} tab pages back. Wraps around from the first one 152 {count}gT Go {count} tab pages back. Wraps around from the first one
150 to the last one. 153 to the last one.
151 154
152 :tabr[ewind] *:tabfir* *:tabfirst* *:tabr* *:tabrewind* 155 :tabr[ewind] *:tabfir* *:tabfirst* *:tabr* *:tabrewind*
153 :tabfir[st] Go to the first tab page. 156 :tabfir[st] Go to the first tab page.
201 Close Close the tab page under the mouse pointer. The 204 Close Close the tab page under the mouse pointer. The
202 current one if there is no label under the mouse 205 current one if there is no label under the mouse
203 pointer. 206 pointer.
204 New Tab Open a tab page, editing an empty buffer. It appears 207 New Tab Open a tab page, editing an empty buffer. It appears
205 to the left of the mouse pointer. 208 to the left of the mouse pointer.
206 Open Tab... Like "New Tab" and additionaly use a file selector to 209 Open Tab... Like "New Tab" and additionally use a file selector to
207 select a file to edit. 210 select a file to edit.
208 211
209 Diff mode works per tab page. You can see the diffs between several files 212 Diff mode works per tab page. You can see the diffs between several files
210 within one tab page. Other tab pages can show differences between other 213 within one tab page. Other tab pages can show differences between other
211 files. 214 files.
245 always. 248 always.
246 249
247 The highlighting of the tab pages line is set with the groups TabLine 250 The highlighting of the tab pages line is set with the groups TabLine
248 TabLineSel and TabLineFill. |hl-TabLine| |hl-TabLineSel| |hl-TabLineFill| 251 TabLineSel and TabLineFill. |hl-TabLine| |hl-TabLineSel| |hl-TabLineFill|
249 252
253 A "+" will be shown for a tab page that has a modified window. The number of
254 windows in a tabpage is also shown. Thus "3+" means three windows and one of
255 them has a modified buffer.
256
250 The 'tabline' option allows you to define your preferred way to tab pages 257 The 'tabline' option allows you to define your preferred way to tab pages
251 labels. This isn't easy, thus an example will be given here. 258 labels. This isn't easy, thus an example will be given here.
252 259
253 For basics see the 'statusline' option. The same items can be used in the 260 For basics see the 'statusline' option. The same items can be used in the
254 'tabline' option. Additionally, the |tabpagebuflist()|, |tabpagenr()| and 261 'tabline' option. Additionally, the |tabpagebuflist()|, |tabpagenr()| and
255 |tabpagewinnr()| functions are useful. 262 |tabpagewinnr()| functions are useful.
256 263
257 Since the number of tab labels will vary, you need to use an expresion for the 264 Since the number of tab labels will vary, you need to use an expression for
258 whole option. Something like: > 265 the whole option. Something like: >
259 :set tabline=%!MyTabLine() 266 :set tabline=%!MyTabLine()
260 267
261 Then define the MyTabLine() function to list all the tab pages labels. A 268 Then define the MyTabLine() function to list all the tab pages labels. A
262 convenient method is to split it in two parts: First go over all the tab 269 convenient method is to split it in two parts: First go over all the tab
263 pages and define labels for them. Then get the label for each tab page. > 270 pages and define labels for them. Then get the label for each tab page. >
298 return bufname(buflist[winnr - 1]) 305 return bufname(buflist[winnr - 1])
299 endfunction 306 endfunction
300 307
301 This is just a simplistic example that results in a tab pages line that 308 This is just a simplistic example that results in a tab pages line that
302 resembles the default, but without adding a + for a modified buffer or 309 resembles the default, but without adding a + for a modified buffer or
303 trunctating the names. You will want to reduce the width of labels in a 310 truncating the names. You will want to reduce the width of labels in a
304 clever way when there is not enough room. Check the 'columns' option for the 311 clever way when there is not enough room. Check the 'columns' option for the
305 space available. 312 space available.
306 313
307 ============================================================================== 314 ==============================================================================
308 5. Setting 'guitablabel' *setting-guitablabel* 315 5. Setting 'guitablabel' *setting-guitablabel*
328 A simple example that puts the tab page number and the buffer name in the 335 A simple example that puts the tab page number and the buffer name in the
329 label: > 336 label: >
330 :set guitablabel=%N\ %f 337 :set guitablabel=%N\ %f
331 338
332 An example that resembles the default 'guitablabel': Show the number of 339 An example that resembles the default 'guitablabel': Show the number of
333 windows in the tab page and a '+' if there is a modifed buffer: > 340 windows in the tab page and a '+' if there is a modified buffer: >
334 341
335 function GuiTabLabel() 342 function GuiTabLabel()
336 let label = '' 343 let label = ''
337 let bufnrlist = tabpagebuflist(v:lnum) 344 let bufnrlist = tabpagebuflist(v:lnum)
338 345