a
file name is expected)
|:<afile>| <afile> file name, for use in an autocommand (only where a
file name is expected)
|:<amatch>| <amatch> what matched with the pattern, for use in an
autocommand (only where a file name is expected)
|:<cword>| <cword> word under the cursor (only where a file name is
expected)
|:<cWORD>| <cWORD> WORD under the cursor (only where a file name is
expected) (see |WORD|)
|:<cfile>| <cfile> file name under the cursor (only where a file name is
expected)
|:<sfile>| <sfile> file name of a ":source"d file, within that file (only
where a file name is expected)
After "%", "#", "<cfile>", "<sfile>" or "<afile>"
|::p| :p full path
|::h| :h head (file name removed)
|::t| :t tail (file name only)
|::r| :r root (extension removed)
|::e| :e extension
|::s| :s/{pat}/{repl}/ substitute {pat} with {repl}
------------------------------------------------------------------------------
*Q_st* Starting Vim
|-file| vim [options] {file} .. start editing one or more files
|--| vim [options] - read file from stdin
|-tag| vim [options] -t {tag} edit the file associated with {tag}
|-qf| vim [options] -q [fname] start editing in QuickFix mode,
display the first error
Most useful Vim arguments (for full list see |startup-options|)
|-+| +[num] put the cursor at line [num] (default: last line)
|-+c| +{command} execute {command} after loading the file
|-+/| +/{pat} {file} .. put the cursor at the first occurrence of {pat}
|-e| -e Ex mode, start vim in Ex mode
|-R| -R Read-only mode, implies -n
|-m| -m modifications not allowed (resets 'write' option)
|-d| -d |diff-mode|
|-b| -b binary mode
|-l| -l lisp mode
|-A| -A Arabic mode ('arabic' is set)
|-H| -H Hebrew mode (Hebrew keymap & 'rightleft' are set)
|-V| -V Verbose, give informative messages
|-r| -r give list of swap files
|-r| -r {file} .. recover aborted edit session
|-n| -n do not create a swap file
|-o| -o [num] open [num] windows (default: one for each file)
|-s| -s {scriptin} first read commands from the file {scriptin}
|-w| -w {scriptout} write typed chars to file {scriptout} (append)
|-W| -W {scriptout} write typed chars to file {scriptout} (overwrite)
|-u| -u {vimrc} read inits from {vimrc} instead of other inits
|-i| -i {shada} read info from {shada} instead of other files
|---| -- end of options, other arguments are file names
|--help| --help show list of arguments and exit
|--version| --version show version info and exit
|--| - read file from stdin
------------------------------------------------------------------------------
*Q_ed* Editing a file
Without !: Fail if changes have been made to the current buffer.
With !: Discard any changes to the current buffer.
|:edit_f| :e[dit][!] {file} edit {file}
|:edit| :e[dit][!] reload the current file
|:enew| :ene[w][!] edit a new, unnamed buffer
|:find| :fin[d][!] {file} find {file} in 'path' and edit it
|CTRL-^| N CTRL-^ edit alternate file N (equivalent to ":e #N")
|gf| gf or ]f edit the file whose name is under the cursor
|:pwd| :pwd print the current directory name
|:cd| :cd [path] change the current directory to [path]
|:cd-| :cd - back to previous current directory
|:file| :f[ile] print the current file name and the cursor
position
|:file| :f[ile] {name} set the current file name to {name}
|:files| :files show alternate file names
------------------------------------------------------------------------------
*Q_fl* Using the argument list |argument-list|
|:args| :ar[gs] print the argument list, with the current file
in "[]"
|:all| :all or :sall open a window for every file in the arg list
|:wn| :wn[ext][!] write file and edit next file
|:wn| :wn[ext][!] {file} write to {file} and edit next