I know how to open a file in vim from a terminal command line (vim fileName
). What I can't figure out is how to open a file when I'm already within Vim. I tried :r fileName
, but that appears to read (or append) the file into the unsaved buffer I have open. It creates a new file, because when I try to write it with :w
, it asks for a filename.
相关问题
- Emacs shell: save commit message
- How to change the first two uppercase characters o
- Insert text into current buffer from function
- Hot reload on save
- Substituting zero-width match in vim script
相关文章
- 如何让 vim 支持 .cshtml 文件的代码高亮
- Auto-save in VIM as you type
- How can I use gcc's -I command to add recursiv
- Vim: overloaded mapping for multiple modes
- vi editor is not responding
- How to use relative line numbering universally in
- How to copy the value of a vim option to a registe
- E185: Cannot find color scheme*
:e <filename>
or
:Ex <directory>
lets you browse for the file from the given directory.
:Ex
on its own will open the pwd.:enew
will create an empty buffer.
this vim command you won't forget:
if you want to point to certain dir, then
:Sex <dir>
Also, to open multiple files (or just one, so I tend to use this for opening a single file, since
:e
fails to open multiple files):n
resets the argument list so it is as if you had entered them on the command line (so commands like:rew
will work with this list), but:e
does not.