Start anew
[msysgit.git] / share / vim / vim58 / doc / windows.txt
blobceb5f6f1eb660aa2b1aa0be1ea4dbd72144d38fa
1 *windows.txt*   For Vim version 5.8.  Last change: 2000 Apr 09
4                   VIM REFERENCE MANUAL    by Bram Moolenaar
7 Editing with multiple windows and buffers.              *windows* *buffers*
9 The commands which have been added to use multiple windows and buffers are
10 explained here.  Additionally, there are explanations for commands that work
11 differently when used in combination with more than one window.
13 1.  Introduction                        |windows-intro|
14 2.  Starting Vim                        |windows-starting|
15 3.  Opening and closing a window        |opening-window|
16 4.  Moving cursor to other windows      |window-move-cursor|
17 5.  Moving windows around               |window-moving|
18 6.  Window resizing                     |window-resize|
19 7.  Exiting Vim                         |window-exit|
20 8.  Writing with multiple buffers       |buffer-write|
21 9.  argument and buffer list commands   |buffer-list|
22 10. Tag or file name under the cursor   |window-tag|
23 11. Using hidden buffers                |buffer-hidden|
25 {Vi does not have any of these commands}
27 ==============================================================================
28 1. Introduction                                         *windows-intro*
30 A window is a viewport onto a buffer.  You can use multiple windows on one
31 buffer, or several windows on different buffers.
33 A buffer is a file loaded into memory for editing.  The original file remains
34 unchanged until you write the buffer to the file.
36 A buffer can be in one of three states:
38                                                         *active-buffer*
39 active:   The buffer is displayed in a window.  If there is a file for this
40           buffer, it has been read into the buffer.  The buffer may have been
41           modified.
42                                                         *hidden-buffer*
43 hidden:   The buffer is not displayed.  If there is a file for this buffer, it
44           has been read into the buffer.  The buffer may have been modified.
45                                                         *inactive-buffer*
46 inactive: The buffer is not displayed and does not contain anything.  Options
47           for the buffer are remembered if the file was once loaded.
49 In a table:
51 state           displayed       loaded          ":buffers"  ~
52                 in window                       shows       ~
53 active            yes            yes              ' '
54 hidden            no             yes              'h'
55 inactive          no             no               '-'
57 ==============================================================================
58 2. Starting Vim                                         *windows-starting*
60 By default, Vim starts with one window, just like Vi.
62 The "-o" argument to Vim can be used to open a window for each file in the
63 argument list: "Vim -o file1 file2 file3" will open three windows.
65 "-oN", where N is a decimal number, opens N windows.  If there are more
66 file names than windows, only N windows are opened and some files do not get a
67 window.  If there are more windows than file names, the last few windows will
68 be editing empty buffers.
70 If there are many file names, the windows will become very small.  You might
71 want to set the 'winheight' option to create a workable situation.
73 Buf/Win Enter/Leave autocommands are not executed when opening the new windows
74 and reading the files, that's only done when they are really entered.
76                                                         *status-line*
77 A status line will be used to separate windows.  The 'laststatus' option tells
78 when the last window also has a status line:
79         'laststatus' = 0        never a status line
80         'laststatus' = 1        status line if there is more than one window
81         'laststatus' = 2        always a status line
83 You can change the contents of the status line with the 'statusline' option.
85 Normally, inversion is used to display the status line.  This can be changed
86 with the 's' character in the 'highlight' option.  For example, "sb" sets it to
87 bold characters.  If no highlighting is used for the status line ("sn"), the
88 '^' character is used for the current window, and '=' for other windows.  If
89 the mouse is supported and enabled with the 'mouse' option, a status line can
90 be dragged to resize windows.
92 Note: If you expect your status line to be in reverse video and it isn't,
93 check if the 'highlight' option contains "si".  In version 3.0, this meant to
94 invert the status line.  Now it should be "sr", reverse the status line, as
95 "si" now stands for italic!  If italic is not available on your terminal, the
96 status line is inverted anyway; you will only see this problem on terminals
97 that have termcap codes for italics.
99 ==============================================================================
100 3. Opening and closing a window                         *opening-window*
102 CTRL-W s                                                *CTRL-W_s*
103 CTRL-W S                                                *CTRL-W_S*
104 CTRL-W CTRL-S                                           *CTRL-W_CTRL-S*
105 :[N]sp[lit] [+cmd]                                      *:sp* *:split*
106                 Split current window in two.  The result is two viewports on
107                 the same file.  Make new window N high (default is to use half
108                 the height of the current window).  Reduces the current window
109                 height to create room (and others, if the 'equalalways' option
110                 is set).  (Note: CTRL-S does not work on all terminals).  Also
111                 see |+cmd|.
113 CTRL-W n                                                *CTRL-W_n*
114 CTRL-W CTRL_N                                           *CTRL-W_CTRL-N*
115 :[N]new [+cmd]                                          *:new*
116                 Create a new window and start editing an empty file in it.
117                 Make new window N high (default is to use half the existing
118                 height).  Reduces the current window height to create room (and
119                 others, if the 'equalalways' option is set).  Also see
120                 |+cmd|.  If 'fileformats' is not empty, the first format given
121                 will be used for the new buffer.  If 'fileformats' is empty,
122                 the 'fileformat' of the current buffer is used.
123                 Autocommands are executed in this order:
124                 1. WinLeave for the current window
125                 2. WinEnter for the new window
126                 3. BufLeave for the current buffer
127                 4. BufEnter for the new buffer
128                 This behaves like a ":split" first, and then a ":e" command.
130 :[N]new [+cmd] {file}
131 :[N]sp[lit] [+cmd] {file}                               *:split_f*
132                 Create a new window and start editing file {file} in it.  If
133                 [+cmd] is given, execute the command when the file has been
134                 loaded |+cmd|.  Make new window N high (default is to use half
135                 the existing height).  Reduces the current window height to
136                 create room (and others, if the 'equalalways' option is set).
138 :[N]sv[iew] [+cmd] {file}                       *:sv* *:sview* *splitview*
139                 Same as ":split", but set 'readonly' option for this buffer.
141 :[N]sf[ind] [+cmd] {file}                       *:sf* *:sfind* *splitfind*
142                 Same as ":split", but search for {file} in 'path'.  Doesn't
143                 split if {file} is not found.
145 CTRL-W CTRL-^                                   *CTRL-W_CTRL-^* *CTRL-W_^*
146 CTRL-W ^        Does ":split #", split window in two and edit alternate file.
147                 When a count is given, it becomes ":split #N", split window
148                 and edit buffer N.
150 Closing a window
151 ----------------
153 CTRL-W q                                                *CTRL-W_q*
154 CTRL-W CTRL-Q                                           *CTRL-W_CTRL-Q*
155 :q[uit]         Quit current window.  When quitting the last window (not
156                 counting a help window), exit Vim.
157                 When 'hidden' is set, and there is only one window for the
158                 current buffer, it becomes hidden.
159                 When 'hidden' is not set, and there is only one window for the
160                 current buffer, and the buffer was changed, the command fails.
161                 (Note: CTRL-Q does not work on all terminals)
163 :q[uit]!        Quit current window.  If this was the last window for a buffer,
164                 any changes to that buffer are lost.  When quitting the last
165                 window (not counting help windows), exit Vim.  The contents of
166                 the buffer are lost, even when 'hidden' is set.
168 CTRL-W c                                        *CTRL-W_c* *:clo* *:close*
169 :clo[se][!]     Close current window.  When the 'hidden' option is set, or
170                 when the buffer was changed and the [!] is used, the buffer
171                 becomes hidden (unless there is another window editing it).
172                 This command fails when:
173                 - There is only one window on the screen.
174                 - When 'hidden' is not set, [!] is not used, the buffer has
175                   changes, and there is no other window on this buffer.
176                 Changes to the buffer are not written and won't get lost, so
177                 this is a "safe" command.
179 CTRL-W CTRL-C                                           *CTRL-W_CTRL-C*
180                 You might have expected that CTRL-W CTRL-C closes the current
181                 window, but that does not work, because the CTRL-C cancels the
182                 command.
184                                                         *:hide*
185 :hid[e]         Quit current window, unless it is the last window on the
186                 screen.  The buffer becomes hidden (unless there is another
187                 window editing it).
188                 The value of 'hidden' is irrelevant for this command.
189                 Changes to the buffer are not written and won't get lost, so
190                 this is a "safe" command.
192 CTRL-W o                                                *CTRL-W_o*
193 CTRL-W CTRL-O                                   *CTRL-W_CTRL-O* *:on* *:only*
194 :on[ly][!]      Make the current window the only one on the screen.  All other
195                 windows are closed.
196                 When the 'hidden' option is set, all buffers in closed windows
197                 become hidden.
198                 When 'hidden' is not set, and the 'autowrite' option is set,
199                 modified buffers are written.  Otherwise, windows that have
200                 buffers that are modified are not removed, unless the [!] is
201                 given, then they become hidden.  But modified buffers are
202                 never abandoned, so changes cannot get lost.
204 ==============================================================================
205 4. Moving cursor to other windows                       *window-move-cursor*
207 CTRL-W <Down>                                   *CTRL-W_<Down>*
208 CTRL-W CTRL-J                                   *CTRL-W_CTRL-J* *CTRL-W_j*
209 CTRL-W j        move cursor to Nth window below current one.
211 CTRL-W <Up>                                     *CTRL-W_<Up>*
212 CTRL-W CTRL-K                                   *CTRL-W_CTRL-K* *CTRL-W_k*
213 CTRL-W k        move cursor to Nth window above current one.
215 CTRL-W w                                        *CTRL-W_w* *CTRL-W_CTRL-W*
216 CTRL-W CTRL-W   Without count: move cursor to window below current one.  If
217                 there is no window below, go to top window.
218                 With count: go to Nth window.
220                                                 *CTRL-W_W*
221 CTRL-W W        Without count: move cursor to window above current one.  If
222                 there is no window above, go to bottom window.
223                 With count: go to Nth window.
225 CTRL-W t                                        *CTRL-W_t* *CTRL-W_CTRL-T*
226 CTRL-W CTRL-T   move cursor to top window.
228 CTRL-W b                                        *CTRL-W_b* *CTRL-W_CTRL-B*
229 CTRL-W CTRL-B   move cursor to bottom window.
231 CTRL-W p                                        *CTRL-W_p* *CTRL-W_CTRL-P*
232 CTRL-W CTRL-P   go to previous (last accessed) window.
234 If Visual mode is active and the new window is not for the same buffer, the
235 Visual mode is ended.
237 ==============================================================================
238 5. Moving windows around                                *window-moving*
240 CTRL-W r                                        *CTRL-W_r* *CTRL-W_CTRL-R*
241 CTRL-W CTRL-R   Rotate windows downwards.  The first window becomes the second
242                 one, the second one becomes the third one, etc.  The last
243                 window becomes the first window.  The cursor remains in the
244                 same window.
246                                                 *CTRL-W_R*
247 CTRL-W R        Rotate windows upwards.  The second window becomes the first
248                 one, the third one becomes the second one, etc.  The first
249                 window becomes the last window.  The cursor remains in the
250                 same window.
252 CTRL-W x                                        *CTRL-W_x* *CTRL-W_CTRL-X*
253 CTRL-W CTRL-X   Without count: Exchange current window with next one.  If there
254                 is no next window, exchange with previous window.
255                 With count: Exchange current window with Nth window (first
256                 window is 1).  The cursor is put in the other window.
258 ==============================================================================
259 6. Window resizing                                      *window-resize*
261                                                 *CTRL-W_=*
262 CTRL-W =        make all windows (almost) equally high.
264 :res[ize] -N                                    *:res* *:resize* *CTRL-W_-*
265 CTRL-W -        decrease current window height by N
267 :res[ize] +N                                    *CTRL-W_+*
268 CTRL-W +        increase current window height by N
270 :res[ize] [N]
271 CTRL-W CTRL-_                                   *CTRL-W_CTRL-_* *CTRL-W__*
272 CTRL-W _        set current window height to N (default: highest possible)
274 z{nr}<CR>       set current window height to {nr}
276 You can also resize the window by dragging a status line up or down with the
277 mouse.  This only works if the version of Vim that is being used supports the
278 mouse and the 'mouse' option has been set to enable it.
280 The option 'winheight' ('wh') is used to set the minimal window height of the
281 current window.  This option is used each time another window becomes the
282 current window.  If the option is '0', it is disabled.  Set 'winheight' to a
283 very large value, e.g., '9999', to make the current window always fill all
284 available space.  Set it to a reasonable value, e.g., '10', to make editing in
285 the current window comfortable.
287 When the option 'equalalways' ('ea') is set, all the windows are automatically
288 made the same size after splitting or closing a window.  If you don't set this
289 option, splitting a window will reduce the size of the current window and
290 leave the other windows the same.  When closing a window, the extra lines are
291 given to the window above it.
293 The option 'cmdheight' ('ch') is used to set the height of the command-line.
294 If you are annoyed by the |hit-return| prompt for long messages, set this
295 option to 2 or 3.
297 If there is only one window, resizing that window will also change the command
298 line height.  If there are several windows, resizing the current window will
299 also change the height of the window below it (and sometimes the window above
300 it).
302 ==============================================================================
303 7. Exiting Vim                                          *window-exit*
305                                                         *:qa* *:qall*
306 :qa[ll]         Exit Vim, unless there are some buffers which have been
307                 changed.  (Use ":bmod" to go to the next modified buffer).
309 :conf[irm] qa[ll]
310                 Exit Vim.  Bring up a prompt when some buffers have been
311                 changed.  See |:confirm|.
313 :qa[ll]!        Exit Vim.  Any changes to buffers are lost.
315 :wqa[ll]                                        *:wqa* *:wqall* *:xa* *:xall*
316 :xa[ll]         Write all changed buffers and exit Vim.  If there are buffers
317                 without a file name, which are readonly or which cannot be
318                 written for another reason, Vim is not quit.
320 :conf[irm] wqa[ll]
321 :conf[irm] xa[ll]
322                 Write all changed buffers and exit Vim.  Bring up a prompt
323                 when some buffers are readonly or cannot be written for
324                 another reason.  See |:confirm|.
326 :wqa[ll]!
327 :xa[ll]!        Write all changed buffers, even the ones that are readonly,
328                 and exit Vim.  If there are buffers without a file name or
329                 which cannot be written for another reason, Vim is not quit.
331 ==============================================================================
332 8. Writing with multiple buffers                        *buffer-write*
334                                                         *:wa* *:wall*
335 :wa[ll]         Write all changed buffers.  Buffers without a file name or
336                 which are readonly are not written.
338 :wa[ll]!        Write all changed buffers, even the ones that are readonly.
339                 Buffers without a file name are not written.
341 ==============================================================================
342 9. argument and buffer list commands                    *buffer-list*
344       args list                buffer list         meaning ~
345 1. :[N]argument [N]     11. :[N]buffer [N]      to arg/buf N
346 2. :[N]next [file ..]   12. :[N]bnext [N]       to Nth next arg/buf
347 3. :[N]Next [N]         13. :[N]bNext [N]       to Nth previous arg/buf
348 4. :[N]previous [N]     14. :[N]bprevious [N]   to Nth previous arg/buf
349 5. :rewind              15. :brewind            to first arg/buf
350 6. :last                16. :blast              to last arg/buf
351 7. :all                 17. :ball               edit all args/buffers
352                         18. :unhide             edit all loaded buffers
353                         19. :[N]bmod [N]        to Nth modified buf
355   split & args list       split & buffer list      meaning ~
356 21. :[N]sargument [N]   31. :[N]sbuffer [N]     split + to arg/buf N
357 22. :[N]snext [file ..] 32. :[N]sbnext [N]      split + to Nth next arg/buf
358 23. :[N]sNext [N]       33. :[N]sbNext [N]      split + to Nth previous arg/buf
359 24. :[N]sprevious [N]   34. :[N]sbprevious [N]  split + to Nth previous arg/buf
360 25. :srewind            35. :sbrewind           split + to first arg/buf
361 26. :slast              36. :sblast             split + to last arg/buf
362 27. :sall               37: :sball              edit all args/buffers
363                         38. :sunhide            edit all loaded buffers
364                         39. :[N]sbmod [N]       split + to Nth modified buf
366 40. :args               list of arguments
367 41. :buffers            list of buffers
369 The meaning of [N] depends on the command:
370  [N] is number of buffers to go forward/backward on ?2, ?3, and ?4
371  [N] is an argument number, defaulting to current argument, for 1 and 21
372  [N] is a buffer number, defaulting to current buffer, for 11 and 31
373  [N] is a count for 19 and 39
375 Note: ":next" is an exception, because it must accept a list of file names
376 for compatibility with Vi.
379 The argument list and multiple windows
380 --------------------------------------
382 The current position in the argument list can be different for each window.
383 Remember that when doing ":e file", the position in the argument list stays
384 the same, but you are not editing the file at that position.  To indicate
385 this, the file message (and the title, if you have one) shows
386 "(file (N) of M)", where "(N)" is the current position in the file list, and
387 "M" the number of files in the file list.
389 All the entries in the argument list are added to the buffer list.  Thus, you
390 can also get to them with the buffer list commands, like ":bnext".
392 :[N]al[l][!] [N]                                *:al* *:all* *:sal* *:sall*
393 :[N]sal[l][!] [N]
394                 Rearrange the screen to open one window for each argument.
395                 All other windows are closed.  When a count is given, this is
396                 the maximum number of windows to open.
397                 When the 'hidden' option is set, all buffers in closed windows
398                 become hidden.
399                 When 'hidden' is not set, and the 'autowrite' option is set,
400                 modified buffers are written.  Otherwise, windows that have
401                 buffers that are modified are not removed, unless the [!] is
402                 given, then they become hidden.  But modified buffers are
403                 never abandoned, so changes cannot get lost.
404                 Buf/Win Enter/Leave autocommands are not executed for the new
405                 windows here, that's only done when they are really entered.
407 :[N]sa[rgument][!] [N]                          *:sa* *:sargument*
408                 Short for ":split | argument [N]": split window and go to Nth
409                 argument.  But when there is no such argument, the window is
410                 not split.
412 :[N]sn[ext][!] [file ..]                                *:sn* *:snext*
413                 Short for ":split | [N]next": split window and go to Nth next
414                 argument.  But when there is no next file, the window is not
415                 split.
417 :[N]spr[evious][!] [N]                          *:spr* *:sprevious*
418 :[N]sN[ext][!] [N]                              *:sN* *:sNext*
419                 Short for ":split | [N]Next": split window and go to Nth
420                 previous argument.  But when there is no previous file, the
421                 window is not split.
423                                                 *:sr* *:srewind*
424 :sr[ewind][!]   Short for ":split | rewind": split window and go to first
425                 argument.  But when there is no argument list, the window is
426                 not split.
428                                                 *:sla* *:slast*
429 :sla[st][!]     Short for ":split | last": split window and go to last
430                 argument.  But when there is no argument list, the window is
431                 not split.
433 ==============================================================================
434 10. Tag or file name under the cursor                   *window-tag*
436                                                         *:sta* *:stag*
437 :sta[g][!] [tagname]
438                 Does ":tag[!] [tagname]" and splits the window for the found
439                 tag.  See also |:tag|.
441 CTRL-W ]                                        *CTRL-W_]* *CTRL-W_CTRL-]*
442 CTRL-W CTRL-]   Split current window in two.  Use identifier under cursor as a
443                 tag and jump to it in the new upper window.  Make new window N
444                 high.
446                                                         *CTRL-W_g]*
447 CTRL-W g ]      Split current window in two.  Use identifier under cursor as a
448                 tag and perform ":tselect" on it in the new upper window.
449                 Make new window N high.
451                                                         *CTRL-W_g_CTRL-]*
452 CTRL-W g CTRL-] Split current window in two.  Use identifier under cursor as a
453                 tag and perform ":tjump" on it in the new upper window.  Make
454                 new window N high.
456                                                         *:pta* *:ptag*
457 :pta[g][!] [tagname]
458                 Does ":tag[!] [tagname]" and shows the found tag in a
459                 "Preview" window without changing the current buffer or cursor
460                 position. If a "Preview" window already exists, it is re-used
461                 (like a help window is).  If a new one is opened,
462                 'previewheight' is used for the height of the window.   See
463                 also |:tag|.
464                 Example:                                *CursorHold-example*
465 >   au! CursorHold *.[ch] nested exe "ptag " . expand("<cword>")
466                 This will cause a ":ptag" to be executed for the keyword under
467                 the cursor, when the cursor hasn't moved for the time set with
468                 'updatetime'.  The "nested" makes other autocommands be
469                 executed, so that syntax highlighting works in the preview
470                 window.  Also see |CursorHold|.  Note: this isn't perfect, you
471                 will get error messages when the cursor rests on a word that
472                 isn't a tag.
474 CTRL-W z                                        *CTRL-W_z*
475 CTRL-W CTRL-Z                                   *CTRL-W_CTRL-Z* *:pc* *:pclose*
476 :pc[lose][!]    Close any "Preview" windows currently open.  When the 'hidden'
477                 option is set, or when the buffer was changed and the [!] is
478                 used, the buffer becomes hidden (unless there is another
479                 window editing it).  The command fails if any "Preview" buffer
480                 cannot be closed.  See also |:close|.
482                                                         *:pp* *:ppop*
483 :[count]pp[op][!]
484                 Does ":[count]pop[!]" in the preview window.  See |:pop| and
485                 |:ptag|.  {not in Vi}
487 CTRL-W }                                                *CTRL-W_}*
488                 Use identifier under cursor as a tag and perform a :ptag on
489                 it. Make the new Preview window (if required) N high.  If N is
490                 not given, 'previewheight' is used.
492 CTRL-W g }                                              *CTRL-W_g}*
493                 Use identifier under cursor as a tag and perform a :ptjump on
494                 it. Make the new Preview window (if required) N high.  If N is
495                 not given, 'previewheight' is used.
497 CTRL-W f                                        *CTRL-W_f* *CTRL-W_CTRL-F*
498 CTRL-W CTRL-F   Split current window in two.  Edit file name under cursor.
499                 Like ":split ]f", but window isn't split if the file does not
500                 exist.
501                 Uses the 'path' variable as a list of directory names where to
502                 look for the file.  Also the path for current file is
503                 used to search for the file name.
504                 If the name is a hypertext link that looks like
505                 "type://machine/path", only "/path" is used.
506                 If a count is given, the count'th matching file is edited.
507                 Not available when the |+file_in_path| feature was disabled at
508                 compile time.
510 Also see |CTRL-W_CTRL-I|: open window for an included file that includes
511 the keyword under the cursor.
513 ==============================================================================
514 11. Using hidden buffers                                *buffer-hidden*
516 A hidden buffer is not displayed in a window, but is still loaded into memory.
517 This makes it possible to jump from file to file, without the need to read or
518 write the file every time you get another buffer in a window.
520                                                         *:buffer-!*
521 If the option 'hidden' ('hid') is set, abandoned buffers are kept for all
522 commands that start editing another file: ":edit", ":next", ":tag", etc.  The
523 commands that move through the buffer list sometimes make the current buffer
524 hidden although the 'hidden' option is not set.  This happens when a buffer is
525 modified, but is forced (with '!') to be removed from a window, and
526 'autowrite' is off or the buffer can't be written.
528 You can make a hidden buffer not hidden by starting to edit it with any
529 command.  Or by deleting it with the ":bdelete" command.
531                                                         *hidden-quit*
532 When you try to quit Vim while there is a hidden, modified buffer, you will
533 get an error message and Vim will make that buffer the current buffer.  You
534 can then decide to write this buffer (":wq") or quit without writing (":q!").
535 Be careful: there may be more hidden, modified buffers!
537 :files                                          *:files*
538 :buffers                                        *:buffers* *:ls*
539 :ls             Show all buffers.  Example:
541 >                       1 #h  "/test/text"              line 1
542 >                       2  -  "asdf"                    line 0
543 >                       3 % + "version.c"               line 1
545                 Each buffer has a unique number.  That number will not change,
546                 so you can always go to a specific buffer with ":buffer N" or
547                 "N CTRL-^", where N is the buffer number.
549                 '-' indicates a buffer that is not loaded.  'h' indicates a
550                 hidden buffer: It is loaded, but currently not displayed in a
551                 window.  '%' indicates the buffer in the current window.  '#'
552                 indicates the alternate buffer for ":e #" or CTRL-^.  '+'
553                 indicates a modified buffer.
555                                                 *:bad* *:badd*
556 :bad[d] [+lnum] {fname}
557                 Add file name {fname} to the buffer list, without loading it.
558                 If "lnum" is specified, the cursor will be positioned at that
559                 line when the buffer is first entered. Note that other
560                 commands after the + will be ignored.
562 :[N]bd[elete]                                   *:bd* *:bdel* *:bdelete*
563 :bd[elete] [N]
564                 Unload buffer [N] (default: current buffer) and delete it from
565                 the buffer list.  If the buffer was changed, this fails.  The
566                 file remains unaffected.  Any windows for this buffer are
567                 closed.  If buffer [N] is the current buffer, another buffer
568                 will be displayed instead.  This is the most recent entry in
569                 the jump list that points into a loaded buffer.
571 :[N]bdelete!
572 :bdelete! [N]
573                 Unload buffer [N] (default: current buffer) and delete it from
574                 the buffer list.  If the buffer was changed the changes are
575                 lost.  The file remains unaffected.  Any windows for this
576                 buffer are closed.  If buffer [N] is the current buffer,
577                 another buffer will be displayed instead.  This is the most
578                 recent entry in the jump list that points into a loaded
579                 buffer.
582 :bdelete[!] {bufname}
583                 Like ":bdelete[!] [N]", but buffer given by name.  Note that a
584                 buffer whose name is a number cannot be referenced by that
585                 name; use the buffer number instead.  Insert a backslash
586                 before a space in a buffer name.
588 :N,Mbdelete[!]  do ":bdelete[!]" for all buffers in the range N to M
589                 (inclusive).
591 :bdelete[!] N1 N2 ...
592                 do ":bdelete[!]" for buffer N1, N2, etc.  The arguments can be
593                 buffer numbers or buffer names (but not buffer names that are
594                 a number).  Insert a backslash before a space in a buffer
595                 name.
597 :[N]bun[load]                                   *:bun* *:bunload*
598 :bun[load] [N]
599                 Unload buffer [N] (default: current buffer).  The memory
600                 allocated for this buffer will be freed.  The buffer remains
601                 in the buffer list.  If the buffer was changed, this fails.
602                 Any windows for this buffer are closed.  If buffer [N] is the
603                 current buffer, another buffer will be displayed instead.
604                 This is the most recent entry in the jump list that points
605                 into a loaded buffer.
607 :[N]bunload!
608 :bunload! [N]
609                 Unload buffer [N] (default: current buffer).  The memory
610                 allocated for this buffer will be freed.  The buffer remains
611                 in the buffer list.  If the buffer was changed, the changes
612                 are lost.  Any windows for this buffer are closed.  If buffer
613                 [N] is the current buffer, another buffer will be displayed
614                 instead.  This is the most recent entry in the jump list that
615                 points into a loaded buffer.
617 :bunload[!] {bufname}
618                 Like ":bunload[!] [N]", but buffer given by name.  Note that a
619                 buffer whose name is a number cannot be referenced by that
620                 name; use the buffer number instead.  Insert a backslash
621                 before a space in a buffer name.
623 :N,Mbunload[!]  do ":bunload[!]" for all buffers in the range N to M
624                 (inclusive).
626 :bunload[!] N1 N2 ...
627                 do ":bunload[!]" for buffer N1, N2, etc.  The arguments can be
628                 buffer numbers or buffer names (but not buffer names that are
629                 a number).  Insert a backslash before a space in a buffer
630                 name.
632 :[N]b[uffer][!] [N]                                     *:b* *:bu* *:buffer*
633                 Edit buffer [N] from the buffer list.  If [N] is not given,
634                 the current buffer remains being edited.  See |:buffer-!| for
635                 [!].
637 :[N]b[uffer][!] {filename}
638                 Edit buffer for {filename} from the buffer list.  See
639                 |:buffer-!| for [!].
641 :[N]sb[uffer] [N]                                       *:sb* *:sbuffer*
642                 Split window and edit buffer [N] from the buffer list.  If [N]
643                 is not given, the current buffer is edited.  Respects the
644                 "useopen" setting of 'switchbuf' when splitting.
646 :[N]sb[uffer] {filename}
647                 Split window and edit buffer for {filename} from the buffer
648                 list.
650                                                         *:bn* *:bnext*
651 :[N]bn[ext][!] [N]
652                 Go to [N]th next buffer in buffer list.  [N] defaults to one.
653                 Wraps around the end of the buffer list.  See |:buffer-!| for
654                 [!].
655                 If you are in a help buffer, this takes you to the next help
656                 buffer (if there is one). Similarly, if you are in a normal
657                 (non-help) buffer, this takes you to the next normal buffer.
658                 This is so that if you have invoked help, it doesn't get in
659                 the way when you're browsing code/text buffers. The next three
660                 commands also work like this.
662                                                         *:sbn* *:sbnext*
663 :[N]sbn[ext] [N]
664                 Split window and go to [N]th next buffer in buffer list.
665                 Wraps around the end of the buffer list. Uses 'switchbuf'
667 :[N]bN[ext][!] [N]                      *:bN* *:bNext* *:bp* *:bprevious*
668 :[N]bp[revious][!] [N]
669                 Go to [N]th previous buffer in buffer list.  [N] defaults to
670                 one.  Wraps around the start of the buffer list.  See
671                 |:buffer-!| for [!] and 'switchbuf'.
673 :[N]sbN[ext] [N]                        *:sbN* *:sbNext* *:sbp* *:sbprevious*
674 :[N]sbp[revious] [N]
675                 Split window and go to [N]th previous buffer in buffer list.
676 +               Wraps around the start of the buffer list. Uses 'switchbuf'.
678                                                         *:br* *:brewind*
679 :br[ewind][!]   Go to first buffer in buffer list.  See |:buffer-!| for [!].
681                                                         *:sbr* *:sbrewind*
682 :sbr[ewind]     Split window and go to first buffer in buffer list.
683                 Respects 'switchbuf' option.
685                                                         *:bl* *:blast*
686 :bl[ast][!]     Go to last buffer in buffer list.  See |:buffer-!| for [!].
688                                                         *:sbl* *:sblast*
689 :sbl[ast]       Split window and go to last buffer in buffer list.
690                 Respects 'switchbuf' option.
692 :[N]bm[odified][!] [N]                                  *:bm* *:bmodified*
693                 Go to [N]th next modified buffer in buffer list.
695 :[N]sbm[odified] [N]                                    *:sbm* *:sbmodified*
696                 Split window and go to [N]th next modified buffer in buffer
697                 list.  Respects 'switchbuf' option.
699 :[N]unh[ide] [N]                        *:unh* *:unhide* *:sun* *:sunhide*
700 :[N]sun[hide] [N]
701                 Rearrange the screen to open one window for each loaded buffer
702                 in the buffer list.  When a count is given, this is the
703                 maximum number of windows to open.
705 :[N]ba[ll] [N]                                  *:ba* *:ball* *:sba* *:sball*
706 :[N]sba[ll] [N] Rearrange the screen to open one window for each buffer in
707                 the buffer list.  When a count is given, this is the maximum
708                 number of windows to open.  Buf/Win Enter/Leave autocommands
709                 are not executed for the new windows here, that's only done
710                 when they are really entered.
712 Note: All the commands above that start editing another buffer, keep the
713 'readonly' flag as it was.  This differs from the ":edit" command, which sets
714 the 'readonly' flag each time the file is read.
716  vim:ts=8:sw=8:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":