home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / mac / vim54rt.sit / runtime / doc / windows.txt < prev    next >
Encoding:
Text File  |  1999-08-14  |  28.5 KB  |  714 lines  |  [TEXT/ALFA]

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