In: computer, text-editor. Also: emacs-cheatsheet.

Backlinks: emacs-cheatsheet.

Basic movement

Search character (move horizontally)

Search & Replace

Insert, Append, Edit

Reference: https://neovim.io/doc/user/usr_04.html
Some operator-motion commands are used so often that they have been given a single letter command:

Cut and Paste

Note: To make it consistent with D, it’s common to add a mapping for Y in vimrc, like: nnoremap Y y$

Visual mode

Visual commands

Change case

General

Working with multiple files

VIM has 4 layers of abstraction:

Buffers

A buffer directly matches an open file in memory. If you close a window containing a buffer, the buffer is still there, hidden.

Windows

A window is just a space you can use to display the content of a buffer. Don’t forget: when you close the window, the buffer stays open.

To move the cursor from one window to another:

To move the windows:

Resize the windows:

Tabs

So a buffer is an open file, and a window is the container for an active buffer.
The tabs are a container for a bunch of windows. It’s very different than the concept of tabs in a standard IDE!

To move from tab to tab:

Argument List (arglist)

The argument list (also called arglist) is the fourth and last container allowing you to organize your open files.
It’s useful to see it as a stable subset of the buffer list.
Every file in the arglist will be in the buffer list.
Some buffers in the buffer list won’t be in the arglist.
The files you want to open when you run Vim - such as executing vim file1 file2 file3 - will be automatically added to the arglist and to the buffer list.

Mapping Keystrokes

You can add mapping commands for every Vim mode:

Marks and positions

Combos

Articles

Links

×