aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/editing.txt7
-rw-r--r--runtime/doc/map.txt14
-rw-r--r--runtime/doc/tabpage.txt57
-rw-r--r--runtime/doc/windows.txt106
4 files changed, 138 insertions, 46 deletions
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index f2daa9ec24..7c7628cd78 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1,4 +1,4 @@
-*editing.txt* For Vim version 7.4. Last change: 2014 Jul 19
+*editing.txt* For Vim version 7.4. Last change: 2015 Apr 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -801,8 +801,9 @@ current window. The two windows then share this list, until one of them uses
USING THE ARGUMENT LIST
*:argdo*
-:argdo[!] {cmd} Execute {cmd} for each file in the argument list.
- It works like doing this: >
+:[range]argdo[!] {cmd} Execute {cmd} for each file in the argument list or,
+ if [range] is specified, only for arguments in that
+ range. It works like doing this: >
:rewind
:{cmd}
:next
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 1be2827c2c..d4caea198c 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1358,6 +1358,20 @@ Possible attributes are:
Note that -range=N and -count=N are mutually exclusive - only one should be
specified.
+ *E889* *:command-addr*
+It is possible that the special characters in the range like `.`, `$` or `%`
+which by default correspond to the current line, last line and the whole
+buffer, relate to arguments, (loaded) buffers, windows or tab pages.
+
+Possible values are:
+ -addr=lines Range of lines (this is the default)
+ -addr=arguments Range for arguments
+ -addr=buffers Range for buffers (also not loaded buffers)
+ -addr=loaded_buffers Range for loaded buffers
+ -addr=windows Range for windows
+ -addr=tabs Range for tab pages
+
+
Special cases *:command-bang* *:command-bar*
*:command-register* *:command-buffer*
There are some special cases as well:
diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt
index dd3a031020..bb0baf4ccf 100644
--- a/runtime/doc/tabpage.txt
+++ b/runtime/doc/tabpage.txt
@@ -1,4 +1,4 @@
-*tabpage.txt* For Vim version 7.4. Last change: 2012 Aug 08
+*tabpage.txt* For Vim version 7.4. Last change: 2015 Apr 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -61,16 +61,25 @@ In the GUI tab pages line you can use the right mouse button to open menu.
:[count]tabe[dit] *:tabe* *:tabedit* *:tabnew*
:[count]tabnew
Open a new tab page with an empty window, after the current
- tab page. For [count] see |:tab| below.
+ tab page. If [count] is given the new tab page appears after
+ the tabpage [count] otherwise the new tab page will appear
+ after the current one. >
+ :tabnew " opens tabpage after the current one
+ :.tabnew " as above
+ :+tabnew " opens tabpage after the next tab page
+ " note: it is one further than :tabnew
+ :-tabnew " opens tabpage before the current
+ :0tabnew " opens tabpage before the first one
+ :$tabnew " opens tabpage after the last one
:[count]tabe[dit] [++opt] [+cmd] {file}
:[count]tabnew [++opt] [+cmd] {file}
Open a new tab page and edit {file}, like with |:edit|.
- For [count] see |:tab| below.
+ For [count] see |:tabnew| above.
:[count]tabf[ind] [++opt] [+cmd] {file} *:tabf* *:tabfind*
Open a new tab page and edit {file} in 'path', like with
- |:find|. For [count] see |:tab| below.
+ |:find|. For [count] see |:tabnew| above.
{not available when the |+file_in_path| feature was disabled
at compile time}
@@ -110,12 +119,18 @@ something else.
- When 'hidden' is not set, [!] is not used, a buffer has
changes, and there is no other window on this buffer.
Changes to the buffer are not written and won't get lost, so
- this is a "safe" command.
+ this is a "safe" command. >
+ :tabclose " close the current tab page
+:{count}tabc[lose][!]
:tabc[lose][!] {count}
Close tab page {count}. Fails in the same way as `:tabclose`
- above.
-
+ above. >
+ :-tabclose " close the previous tab page
+ :+tabclose " close the next tab page
+ :1tabclose " close the first tab page
+ :$tabclose " close the last tab page
+<
*:tabo* *:tabonly*
:tabo[nly][!] Close all other tab pages.
When the 'hidden' option is set, all buffers in closed windows
@@ -124,7 +139,16 @@ something else.
modified buffers are written. Otherwise, windows that have
buffers that are modified are not removed, unless the [!] is
given, then they become hidden. But modified buffers are
- never abandoned, so changes cannot get lost.
+ never abandoned, so changes cannot get lost. >
+ :tabonly " close all tab pages except the current one
+
+:{count}tabo[nly][!]
+ Close all tab pages except the {count}th one. >
+ :.tabonly " one
+ :-tabonly " close all tab pages except the previous one
+ :+tabonly " close all tab pages except the next one
+ :1tabonly " close all tab pages except the first one
+ :$tabonly " close all tab pages except the last one.
SWITCHING TO ANOTHER TAB PAGE:
@@ -176,8 +200,15 @@ REORDERING TAB PAGES:
:[N]tabm[ove]
Move the current tab page to after tab page N. Use zero to
make the current tab page the first one. Without N the tab
- page is made the last one.
-
+ page is made the last one. >
+ :-tabmove " move the tab page to the left
+ :tabmove " move the tab page to the right
+ :.tabmove " as above
+ :+tabmove " as above
+ :0tabmove " move the tab page to the beginning of the tab
+ " list
+ :$tabmove " move the tab page to the end of the tab list
+<
:tabm[ove] +[N]
:tabm[ove] -[N]
Move the current tab page N places to the right (with +) or to
@@ -191,8 +222,10 @@ clarification what +N means in this context see |[range]|.
LOOPING OVER TAB PAGES:
*:tabd* *:tabdo*
-:tabd[o] {cmd} Execute {cmd} in each tab page.
- It works like doing this: >
+:[range]tabd[o] {cmd}
+ Execute {cmd} in each tab page or, if [range] is given, only
+ in tabpages which tab page number is in the [range]. It works
+ like doing this: >
:tabfirst
:{cmd}
:tabnext
diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index 0098e3e521..782349abe8 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -263,28 +263,54 @@ left of the Vim window.
Closing a window
----------------
+:q[uit]
+:{count}q[uit]
CTRL-W q *CTRL-W_q*
CTRL-W CTRL-Q *CTRL-W_CTRL-Q*
-:q[uit] Quit current window. When quitting the last window (not
- counting a help window), exit Vim.
- When 'hidden' is set, and there is only one window for the
- current buffer, it becomes hidden.
- When 'hidden' is not set, and there is only one window for the
- current buffer, and the buffer was changed, the command fails.
- (Note: CTRL-Q does not work on all terminals)
+ Without {count}: Quit the current window. If {count} is
+ given quit the {count} window
-:q[uit]! Quit current window. If this was the last window for a buffer,
- any changes to that buffer are lost. When quitting the last
- window (not counting help windows), exit Vim. The contents of
- the buffer are lost, even when 'hidden' is set.
+ When quitting the last window (not counting a help window),
+ exit Vim.
+ When 'hidden' is set, and there is only one window for the
+ current buffer, it becomes hidden. When 'hidden' is not set,
+ and there is only one window for the current buffer, and the
+ buffer was changed, the command fails.
+ (Note: CTRL-Q does not work on all terminals).
+ If [count] is greater than the last window number the last
+ window will be closed: >
+ :1quit " quit the first window
+ :$quit " quit the last window
+ :9quit " quit the last window
+ " if there are less than 9 windows opened
+ :-quit " quit the previous window
+ :+quit " quit the next window
+ :+2quit " will also work as expected
+<
+:q[uit]!
+:{count}q[uit]!
+ Without {count}: Quit the current window. If {count} is
+ given quit the {count} window
+ If this was the last window for a buffer, any changes to that
+ buffer are lost. When quitting the last window (not counting
+ help windows), exit Vim. The contents of the buffer are lost,
+ even when 'hidden' is set.
+
+:clo[se][!]
+:{count}clo[se][!]
CTRL-W c *CTRL-W_c* *:clo* *:close*
-:clo[se][!] Close current window. When the 'hidden' option is set, or
- when the buffer was changed and the [!] is used, the buffer
- becomes hidden (unless there is another window editing it).
+ Without {count}: Close the current window. If given close the
+ {count} window.
+
+ When 'hidden' is set, or when the buffer was changed and the
+ [!] is used, the buffer becomes hidden (unless there is another
+ window editing it).
+
When there is only one window in the current tab page and
there is another tab page, this closes the current tab page.
|tab-page|.
+
This command fails when: *E444*
- There is only one window on the screen.
- When 'hidden' is not set, [!] is not used, the buffer has
@@ -297,29 +323,38 @@ CTRL-W CTRL-C *CTRL-W_CTRL-C*
window, but that does not work, because the CTRL-C cancels the
command.
- *:hide*
-:hid[e] Quit current window, unless it is the last window on the
- screen. The buffer becomes hidden (unless there is another
- window editing it or 'bufhidden' is "unload" or "delete").
- If the window is the last one in the current tab page the tab
- page is closed. |tab-page|
+ *:hide*
+:hid[e]
+:{count}hid[e]
+ Quit the current window, unless it is the last window on the
+ screen. For {count} see |:quit|.
+
+ The buffer becomes hidden (unless there is another window
+ editing it or 'bufhidden' is `unload` or `delete`). If the
+ window is the last one in the current tab page the tab page is
+ closed. |tab-page|
+
The value of 'hidden' is irrelevant for this command.
Changes to the buffer are not written and won't get lost, so
this is a "safe" command.
-:hid[e] {cmd} Execute {cmd} with 'hidden' is set. The previous value of
+:hid[e] {cmd} Execute {cmd} with 'hidden' set. The previous value of
'hidden' is restored after {cmd} has been executed.
Example: >
:hide edit Makefile
< This will edit "Makefile", and hide the current buffer if it
has any changes.
+:on[ly][!]
+:{count}on[ly][!]
CTRL-W o *CTRL-W_o* *E445*
CTRL-W CTRL-O *CTRL-W_CTRL-O* *:on* *:only*
-:on[ly][!] Make the current window the only one on the screen. All other
- windows are closed.
+ Make the current window the only one on the screen. All other
+ windows are closed. For {count} see |:quit|.
+
When the 'hidden' option is set, all buffers in closed windows
become hidden.
+
When 'hidden' is not set, and the 'autowrite' option is set,
modified buffers are written. Otherwise, windows that have
buffers that are modified are not removed, unless the [!] is
@@ -660,8 +695,9 @@ can also get to them with the buffer list commands, like ":bnext".
8. Do a command in all buffers or windows *list-repeat*
*:windo*
-:windo {cmd} Execute {cmd} in each window.
- It works like doing this: >
+:[range]windo {cmd} Execute {cmd} in each window or if [range] is given
+ only in windows for which the window number lies in
+ the [range]. It works like doing this: >
CTRL-W t
:{cmd}
CTRL-W w
@@ -679,8 +715,10 @@ can also get to them with the buffer list commands, like ":bnext".
Also see |:tabdo|, |:argdo| and |:bufdo|.
*:bufdo*
-:bufdo[!] {cmd} Execute {cmd} in each buffer in the buffer list.
- It works like doing this: >
+:[range]bufdo[!] {cmd} Execute {cmd} in each buffer in the buffer list or if
+ [range[ is given only for buffers for which their
+ buffer name is in the [range]. It works like doing
+ this: >
:bfirst
:{cmd}
:bnext
@@ -992,8 +1030,11 @@ list of buffers. |unlisted-buffer|
Actually, the buffer isn't completely deleted, it is removed
from the buffer list |unlisted-buffer| and option values,
variables and mappings/abbreviations for the buffer are
- cleared.
-
+ cleared. Examples: >
+ :.,$-bdelete "delete buffers from the current one to
+ " last but one
+ :%bdelete " delete all buffers
+<
:bdelete[!] {bufname} *E93* *E94*
Like ":bdelete[!] [N]", but buffer given by name. Note that a
buffer whose name is a number cannot be referenced by that
@@ -1016,8 +1057,11 @@ list of buffers. |unlisted-buffer|
Like |:bdelete|, but really delete the buffer. Everything
related to the buffer is lost. All marks in this buffer
become invalid, option settings are lost, etc. Don't use this
- unless you know what you are doing.
-
+ unless you know what you are doing. Examples: >
+ :.+,$bwipeout " wipe out all buffers after the current
+ " one
+ :%bwipeout " wipe out all buffers
+<
:[N]bun[load][!] *:bun* *:bunload* *E515*
:bun[load][!] [N]
Unload buffer [N] (default: current buffer). The memory