Skip to content

Instantly share code, notes, and snippets.

@jeromewu
Last active April 29, 2019 09:46
Show Gist options
  • Save jeromewu/a927e5ad0b3ca172c8517f1b05bea792 to your computer and use it in GitHub Desktop.
Save jeromewu/a927e5ad0b3ca172c8517f1b05bea792 to your computer and use it in GitHub Desktop.
vim notes

Operators

Operator Description
x delete a character
A append text in the end of line

Text Objects

Text Object Description
w word starting from cursor
aw a word*
aW a WORD**
iw inner word

* move word which separated by " ,./?"

** move word which separated by " " only

More info: https://blog.carbonfive.com/2011/10/17/vim-text-objects-the-definitive-guide/

Motions

Motion Description
^ beginning of line
$ end of line
w/W go to a word/WORD to the right
b/B go to a word/WORD to the left
e/E go to end of world/WORD right

Command

Command Description
gd go to definition
gf go to file
gt go to next tab
gT go to previous tab
Ctrl-^ go to previous file
Ctrl-O jump back to previous location
Ctrl-I jump to next location
Ctrl-W N enter normal mode in terminal, i or a to go back
Command Description
:tabe create a new tab
:tabc close tab
:tabo close all other tabs
:ls list all buffers
:bn next buffer
:bp previous buffer
:b {number} go to specific buffer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment