files that end in ".c": >
:e *.c$
This will not match a file ending in ".cpp". Without the "$" it does match.
If you would like using <S-Tab> for CTRL-P in an xterm, put this command in
your .cshrc: >
xmodmap -e "keysym Tab = Tab Find"
And this in your vimrc: >
:cmap <Esc>[1~ <C-P>
< *complete-set-option*
When setting an option using |:set=|, the old value of an option can be
obtained by hitting 'wildchar' just after the '='. For example, typing
'wildchar' after ":set dir=" will insert the current value of 'dir'. This
overrules file name completion for the options that take a file name.
When using |:set=|, |:set+=|, or |:set^=|, string options that have
pre-defined names or syntax (e.g. 'diffopt', 'listchars') or are a list of
single-character flags (e.g. 'shortmess') will also present a list of possible
values for completion when using 'wildchar'.
When using |:set-=|, comma-separated options like 'diffopt' or 'backupdir'
will show each item separately. Flag list options like 'shortmess' will show
both the entire old value and the individual flags. Otherwise completion will
just fill in with the entire old value.
==============================================================================
3. Ex command-lines *cmdline-lines*
The Ex commands have a few specialties:
*:quote* *:comment*
'"' at the start of a line causes the whole line to be ignored. '"'
after a command causes the rest of the line to be ignored. This can be used
to add comments. Example: >
:set ai "set 'autoindent' option
It is not possible to add a comment to a shell command ":!cmd" or to the
":map" command and a few others (mainly commands that expect expressions)
that see the '"' as part of their argument:
:argdo
:autocmd
:bufdo
:cexpr (and the like)
:cdo (and the like)
:command
:debug
:display
:echo (and the like)
:elseif
:execute
:folddoopen
:folddoclosed
:for
:grep (and the like)
:help (and the like)
:if
:let
:make
:map (and the like including :abbrev commands)
:menu (and the like)
:mkspell
:normal
:ownsyntax
:popup
:registers
:return
:sort
:syntax
:tabdo
:tearoff
:vimgrep (and the like)
:while
:windo
*:bar* *:\bar*
'|' can be used to separate commands, so you can give multiple commands in one
line. If you want to use '|' in an argument, precede it with '\'.
These commands see the '|' as their argument, and can therefore not be
followed by another Vim command:
:argdo
:autocmd
:bufdo
:cdo
:cfdo
:command
:debug
:eval
:folddoopen
:folddoclosed
:function
:global
:help
:helpgrep
:ldo
:lfdo
:lhelpgrep
:make
:normal
:perlfile
:pyfile
:python
:registers
:read !
:sign
:tabdo
:terminal
:vglobal
:windo
:write !
:[range]!
a user defined command without the "-bar" argument |:command|
Note that this is confusing (inherited from Vi): With ":g" the '|' is included
in the command, with ":s" it is not.
To be able to use another command anyway, use the ":execute" command.
Example (append the output of "ls" and jump to the first line): >
:execute 'r !ls' | '[
There is one exception: When the 'b' flag is present in 'cpoptions', with the
":map" and ":abbr" commands and friends CTRL-V needs to be used instead of
'\'. You can also use "<Bar>" instead. See also |map_bar|.
Examples: >
:!ls | wc view the output of two commands
:r !ls | wc insert the same output in the text
:%g/foo/p|> moves all matching lines one shiftwidth
:%s/foo/bar/|> moves one line one shiftwidth
:map q 10^V| map "q" to "10|"
:map q 10\| map \ l map "q" to "10\" and map "\" to "l"
(when 'b' is present in 'cpoptions')
You can also use <NL> to separate commands in the same way as with '|'. To
insert a <NL> use CTRL-V CTRL-J. "^@" will be shown. Using '|' is the
preferred method. But