/home/mool/vim/src/version.c.gz
:e gz
:e:e c.gz
:e:e:e c.gz
:e:e:r c
:r src/version.c
:r:e c
:r:r src/version
:r:r:r src/version
<
*extension-removal* *:_%<*
If a "<" is appended to "%", "#", "#n" or "CTRL-V p" the extension of the file
name is removed (everything after and including the last '.' in the file
name). This is included for backwards compatibility with version 3.0, the
":r" form is preferred. Examples: >
% current file name
%< current file name without extension
# alternate file name for current window
#< idem, without extension
#31 alternate file number 31
#31< idem, without extension
<cword> word under the cursor
<cWORD> WORD under the cursor (see |WORD|)
<cfile> path name under the cursor
<cfile>< idem, without extension
Note: Where a file name is expected wildcards expansion is done. On Unix the
shell is used for this, unless it can be done internally (for speed).
Backticks work also, like in >
:n `echo *.c`
But expansion is only done if there are any wildcards before expanding the
'%', '#', etc.. This avoids expanding wildcards inside a file name. If you
want to expand the result of <cfile>, add a wildcard character to it.
Examples: (alternate file name is "?readme?")
command expands to >
:e # :e ?readme?
:e `ls #` :e {files matching "?readme?"}
:e #.* :e {files matching "?readme?.*"}
:cd <cfile> :cd {file name under cursor}
:cd <cfile>* :cd {file name under cursor plus "*" and then expanded}
Also see |`=|.
When the expanded argument contains a "!" and it is used for a shell command
(":!cmd", ":r !cmd" or ":w !cmd"), the "!" is escaped with a backslash to
avoid it being expanded into a previously used command. When the 'shell'
option contains "sh", this is done twice, to avoid the shell trying to expand
the "!".
*filename-backslash*
For filesystems that use a backslash as directory separator (Windows
filesystems), it's a bit difficult to recognize a backslash that is used
to escape the special meaning of the next character. The general rule is: If
the backslash is followed by a normal file name character, it does not have a
special meaning. Therefore "\file\foo" is a valid file name, you don't have
to type the backslash twice.
An exception is the '$' sign. It is a valid character in a file name. But
to avoid a file name like "$home" to be interpreted as an environment variable,
it needs to be preceded by a backslash. Therefore you need to use "/\$home"
for the file "$home" in the root directory. A few examples:
FILE NAME INTERPRETED AS ~
$home expanded to value of environment var $home
\$home file "$home" in current directory
/\$home file "$home" in root directory
\\$home file "\\", followed by expanded $home
Also see |`=|.
==============================================================================
7. Command-line window *cmdline-window* *cmdwin*
*command-line-window*
In the command-line window the command line can be edited just like editing
text in any window. It is a special kind of window, because you cannot leave
it in a normal way.
OPEN *c_CTRL-F* *q:* *q/* *q?*
There are two ways to open the command-line window:
1. From Command-line mode, use the key specified with the 'cedit' option.
2. From Normal mode, use the "q:", "q/" or "q?" command.
This starts editing an Ex command-line ("q:") or search string ("q/" or
"q?"). Note that this is not possible while recording is in progress (the
"q" stops recording then).
When the window opens it is filled with the command-line history. The last
line contains the command as typed so far. The left column will show a
character that indicates the type of command-line being edited, see
|cmdwin-char|.
Vim will be in Normal mode when the editor is opened.
The height of the window is specified with 'cmdwinheight' (or smaller if there
is no room). The window is always full width and