home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / vim53os2.zip / vim-5.3 / doc / windows.txt < prev    next >
Text File  |  1998-08-30  |  28KB  |  661 lines

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