aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/editing.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/editing.txt')
-rw-r--r--runtime/doc/editing.txt80
1 files changed, 52 insertions, 28 deletions
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 7dea905c2b..0ad917006f 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1,4 +1,4 @@
-*editing.txt* For Vim version 7.4. Last change: 2015 Jul 28
+*editing.txt* For Vim version 7.4. Last change: 2015 Aug 25
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -381,6 +381,7 @@ Finds files:
On Unix and a few other systems you can also use backticks for the file name
argument, for example: >
:next `find . -name ver\\*.c -print`
+ :view `ls -t *.patch \| head -n1`
The backslashes before the star are required to prevent the shell from
expanding "ver*.c" prior to execution of the find program. The backslash
before the shell pipe symbol "|" prevents Vim from parsing it as command
@@ -398,13 +399,11 @@ The expression can contain just about anything, thus this can also be used to
avoid the special meaning of '"', '|', '%' and '#'. However, 'wildignore'
does apply like to other wildcards.
-Environment variables are expanded before evaluating the expression, thus this
-does not work: >
- :e `=$HOME . '.vimrc'`
-Because $HOME is expanding early, resulting in: >
- :e `=/home/user . '.vimrc'`
-This does work: >
- :e `=expand('$HOME') . '.vimrc'`
+Environment variables in the expression are expanded when evaluating the
+expression, thus this works: >
+ :e `=$HOME . '/.vimrc'`
+This does not work, $HOME is inside a string and used literally: >
+ :e `='$HOME' . '/.vimrc'`
If the expression returns a string then names are to be separated with line
breaks. When the result is a |List| then each item is used as a name. Line
@@ -1217,12 +1216,18 @@ use has("browsefilter"): >
==============================================================================
7. The current directory *current-directory*
-You may use the |:cd| and |:lcd| commands to change to another directory, so
-you will not have to type that directory name in front of the file names. It
-also makes a difference for executing external commands, e.g. ":!ls".
+You can use |:cd|, |:tcd| and |:lcd| to change to another directory, so you
+will not have to type that directory name in front of the file names. It also
+makes a difference for executing external commands, e.g. ":!ls" or ":te ls".
-Changing directory fails when the current buffer is modified, the '.' flag is
-present in 'cpoptions' and "!" is not used in the command.
+There are three current-directory "scopes": global, tab and window. The
+window-local working directory takes precedence over the tab-local
+working directory, which in turn takes precedence over the global
+working directory. If a local working directory (tab or window) does not
+exist, the next-higher scope in the hierarchy applies.
+
+Commands for changing the working directory can be suffixed with a bang "!"
+(e.g. |:cd!|) which is ignored, for compatibility with Vim.
*:cd* *E747* *E472*
:cd[!] On non-Unix systems: Print the current directory
@@ -1247,29 +1252,50 @@ present in 'cpoptions' and "!" is not used in the command.
*:chd* *:chdir*
:chd[ir][!] [path] Same as |:cd|.
+ *:tc* *:tcd* *E5000* *E5001* *E5002*
+:tc[d][!] {path} Like |:cd|, but set the current directory for the
+ current tab and window. The current directory for
+ other tabs and windows is not changed.
+
+ *:tcd-*
+:tcd[!] - Change to the previous current directory (before the
+ previous ":tcd {path}" command).
+
+ *:tch* *:tchdir*
+:tch[dir][!] Same as |:tcd|.
+
*:lc* *:lcd*
:lc[d][!] {path} Like |:cd|, but only set the current directory for the
current window. The current directory for other
- windows is not changed.
+ windows or any tabs is not changed.
*:lch* *:lchdir*
:lch[dir][!] Same as |:lcd|.
+ *:lcd-*
+:lcd[!] - Change to the previous current directory (before the
+ previous ":tcd {path}" command).
+
*:pw* *:pwd* *E187*
:pw[d] Print the current directory name.
Also see |getcwd()|.
-So long as no |:lcd| command has been used, all windows share the same current
-directory. Using a command to jump to another window doesn't change anything
-for the current directory.
-When a |:lcd| command has been used for a window, the specified directory
-becomes the current directory for that window. Windows where the |:lcd|
-command has not been used stick to the global current directory. When jumping
-to another window the current directory will become the last specified local
-current directory. If none was specified, the global current directory is
-used.
-When a |:cd| command is used, the current window will lose his local current
-directory and will use the global current directory from now on.
+So long as no |:tcd| or |:lcd| command has been used, all windows share the
+same "current directory". Using a command to jump to another window doesn't
+change anything for the current directory.
+
+When |:lcd| has been used for a window, the specified directory becomes the
+current directory for that window. Windows where the |:lcd| command has not
+been used stick to the global or tab-local directory. When jumping to another
+window the current directory will become the last specified local current
+directory. If none was specified, the global or tab-local directory is used.
+
+When changing tabs the same behaviour applies. If the current tab has no
+local working directory the global working directory is used. When a |:cd|
+command is used, the current window and tab will lose their local current
+directories and will use the global current directory from now on. When
+a |:tcd| command is used, only the current window will lose its local working
+directory.
After using |:cd| the full path name will be used for reading and writing
files. On some networked file systems this may cause problems. The result of
@@ -1318,9 +1344,7 @@ There are a few things to remember when editing binary files:
9. Encryption *encryption*
*:X* *E817* *E818* *E819* *E820*
-Support for editing encrypted files has been removed, but may be added back in
-the future. See the following discussions for more information:
-
+Support for editing encrypted files has been removed.
https://github.com/neovim/neovim/issues/694
https://github.com/neovim/neovim/issues/701