blob: cf95ca2176680334ab134d582efe53f093785072 [file] [log] [blame]
Bram Moolenaar7e8fd632006-02-18 22:14:51 +00001*tabpage.txt* For Vim version 7.0aa. Last change: 2006 Feb 18
2
3
4 VIM REFERENCE MANUAL by Bram Moolenaar
5
6
7Editing with windows in multuple tab pages. *tab-page* *tabpage*
8
9The commands which have been added to use multiple tab pages are explained
10here. Additionally, there are explanations for commands that work differently
11when used in combination with more than one tab page.
12
131. Introduction |tab-page-intro|
142. Commands |tab-page-commands|
153. Other items |tab-page-other|
16
17{Vi does not have any of these commands}
18{not able to use multiple tab pages when the |+windows| feature was disabled
19at compile time}
20
21==============================================================================
221. Introduction *tab-page-intro*
23
24A tab page holds one or more windows. You can easily switch between tab
25pages, so that you have several collections of windows to work on different
26things.
27
28Usually you will see a list of labels at the top of the Vim window, one for
29each tab page. With the mouse you can click on the label to jump to that tab
30page. There are other ways to move between tab pages, see below.
31
32Most commands work only in the current tab page. That includes the |CTRL-W|
33commands, |:windo|, |:all| and |:ball|. The commands that are aware of
34other tab pages than the current one are mentioned below.
35
36Tabs are also a nice way to edit a buffer temporarily without changing the
37current window layout. Open a new tab page, do whatever you want to do and
38close the tab page.
39
40==============================================================================
412. Commands *tab-page-commands*
42
43OPENING A NEW TAB PAGE:
44
45When starting Vim "vim -p filename ..." opens each file argument in a separate
46tab page (up to 10). |-p|
47
48:tabe[dit] *:tabe* *:tabedit*
49:tabn[ew] Open a new tab page with an empty window.
50
51:tabe[dit] [++opt] [+cmd] {file}
52:tabn[ew] [++opt] [+cmd] {file}
53 Open a new tab page and edit {file}, like with |:edit|.
54
55:tabf[ind] [++opt] [+cmd] {file}
56 Open a new tab page and edit {file} in 'path', like with
57 |:find|.
58 {not available when the |+file_in_path| feature was disabled
59 at compile time}
60
61
62CLOSING A TAB PAGE:
63
64Using |:close| in the last window of a tab page closes it.
65
66Using the mouse: If the tab page line is displayed you can click in the "X" at
67the top right to close the current tab page. |'tabline'|
68
69 *:tabc* *:tabclose*
70:tabc[lose][!] Close current tab page.
71 This command fails when:
72 - There is only one tab page on the screen. *E784*
73 - When 'hidden' is not set, [!] is not used, a buffer has
74 changes, and there is no other window on this buffer.
75 Changes to the buffer are not written and won't get lost, so
76 this is a "safe" command.
77
78:tabc[lose][!] {count}
79 Close tab page {count}. Fails in the same way as ':tabclose"
80 above.
81
82 *:tabo* *:tabonly*
83:tabo[nly][!] Close all other tab pages.
84 When the 'hidden' option is set, all buffers in closed windows
85 become hidden.
86 When 'hidden' is not set, and the 'autowrite' option is set,
87 modified buffers are written. Otherwise, windows that have
88 buffers that are modified are not removed, unless the [!] is
89 given, then they become hidden. But modified buffers are
90 never abandoned, so changes cannot get lost.
91
92
93SWITCHING TO ANOTHER TAB PAGE:
94
95Using the mouse: If the tab page line is displayed you can click in a tab page
96label to switch to that tab page. |'tabline'|
97
98:tab *:tab* *gt*
99gt Go to the next tab page. Wraps around from the last to the
100 first one.
101
102:tab {count}
103{count}gt Go to tab page {count}. The first tab page has number one.
104
105
106Other commands:
107 *:tabs*
108:tabs List the tab pages and the windows they contain. Shows a "+"
109 for modified buffers.
110
111==============================================================================
1123. Other items *tab-page-other*
113
114You can use the 'tabline' option to specify when you want the line with tab
115page labels to appear: never, when there is more than one tab page or always.
116
117Diff mode works per tab page. You can see the diffs between several files
118within one tab page. Other tab pages can show differences between other
119files.
120
121The TabLeavePre and TabEnterPost autocommand events can be used to do
122something when switching from one tab page to another.
123
124
125 vim:tw=78:ts=8:ft=help:norl: