TOOL ยป VIM

Buffer

Creating or editing files โ€‹

The syntax is:

shell
COMMAND OPTION PATH
CommandDescription
:newCreate a new file in a new window.
:e findEdit a file.
:nEdit one or more files.
:w :upWrite buffer contents to file, or only if there are changes.
:savSave as

See also args.

OptionDescription
+NOpen the file and move cursor to the specified line number.
+/searchOpen the file and jump to the first result of the search.
PathDescription
*File or folder name globbing. Ex: test*.py
**Folders globbing. Ex: src/**/file.py
%:hPath to the current directory.
scp://srv-name/Path to a remote file. Path defaults to home directory. Add one more / for absolute path.

Buffer navigation โ€‹

CommandDescription
ls buffersList current opened buffers.
bOpen buffer. Buffer number or file name can be used.
bn bpNext or previous buffer.
bdDelete buffer. Buffer number or file name can be used.

Tips โ€‹

Close all buffers but current.

vim
%bd|e#

Close buffer without closing window.

vim
bp|bd #