format given
will be used for the new buffer. If 'fileformats' is
empty, the 'fileformat' of the current buffer is used.
*:ene!* *:enew!*
:ene[w]! Edit a new, unnamed buffer. Discard any changes to
the current buffer.
Set 'fileformat' like |:enew|.
*:fin* *:find*
:fin[d][!] [++opt] [+cmd] {file}
Find {file} in 'path' and then |:edit| it.
:{count}fin[d][!] [++opt] [+cmd] {file}
Just like ":find", but use the {count} match in
'path'. Thus ":2find file" will find the second
"file" found in 'path'. When there are fewer matches
for the file in 'path' than asked for, you get an
error message.
*:ex*
:ex [++opt] [+cmd] [file]
Same as |:edit|.
*:vi* *:visual*
:vi[sual][!] [++opt] [+cmd] [file]
When used in Ex mode: Leave |Ex-mode|, go back to
Normal mode. Otherwise same as |:edit|.
*:vie* *:view*
:vie[w][!] [++opt] [+cmd] file
When used in Ex mode: Leave |Ex-mode|, go back to
Normal mode. Otherwise same as |:edit|, but set
'readonly' option for this buffer.
*CTRL-^* *CTRL-6*
CTRL-^ Edit the alternate file. Mostly the alternate file is
the previously edited file. This is a quick way to
toggle between two files. It is equivalent to ":e #",
except that it also works when there is no file name.
If the 'autowrite' or 'autowriteall' option is on and
the buffer was changed, write it.
Mostly the ^ character is positioned on the 6 key,
pressing CTRL and 6 then gets you what we call CTRL-^.
But on some non-US keyboards CTRL-^ is produced in
another way.
{count}CTRL-^ Edit [count]th file in the buffer list (equivalent to
":e #[count]"). This is a quick way to switch between
files.
See |CTRL-^| above for further details.
*gf* *E446* *E447*
[count]gf Edit the file whose name is under or after the cursor.
Mnemonic: "goto file".
Uses the 'isfname' option to find out which characters
are supposed to be in a file name. Trailing
punctuation characters ".,:;!" are ignored. Escaped
spaces "\ " are reduced to a single space.
Uses the 'path' option as a list of directory names to
look for the file. See the 'path' option for details
about relative directories and wildcards.
Uses the 'suffixesadd' option to check for file names
with a suffix added.
If the file can't be found, 'includeexpr' is used to
modify the name and another attempt is done.
If a [count] is given, the count'th file that is found
in the 'path' is edited.
This command fails if Vim refuses to |abandon| the
current file.
If you want to edit the file in a new window use
|CTRL-W_CTRL-F|.
If you do want to edit a new file, use: >
:e <cfile>
< To make gf always work like that: >
:map gf :e <cfile><CR>
< If the name is a hypertext link, that looks like
"type://machine/path", you need the |netrw| plugin.
For Unix the '~' character is expanded, like in
"~user/file". Environment variables are expanded too
|expand-env|.
*v_gf*
{Visual}[count]gf Same as "gf", but the highlighted text is used as the
name of the file to edit. 'isfname' is ignored.
Leading blanks are skipped, otherwise all blanks and
special characters are included in the file name.
(For {Visual} see |Visual-mode|.)
*gF*
[count]gF Same as "gf", except if a number follows the file
name, then the cursor is positioned on that line in
the file.
The file name and the number must be separated by a
non-filename (see 'isfname') and non-numeric
character. " line " is also recognized, like it is
used in the output of `:verbose command UserCmd`
White space between the filename, the separator and
the number are ignored.
Examples:
eval.c:10 ~
eval.c @ 20 ~
eval.c (30) ~
eval.c 40 ~
*v_gF*
{Visual}[count]gF Same as "v_gf".
These commands are used to start editing a single file. This means that the
file is read into the buffer and the