Vim
Vim is a text editor used by people who are afraid of mice. It is operated entirely through a keyboard.
Motions
Motions are how you move around.
List of motions
- w - move cursor up
- a - move cursor left
- s - move cursor south
- d - move cursor down
- e - put a cursor at every letter of the word or selection
- b - move back one character
- j - jump to the next word
- 0 - does nothing
- ^ - move to start of paragraph
- $ - move to the most computationally expensive character in the line. changes depending on your terminal font
- i - select inside
- o - select outside
- f - select firsts
- l - select lasts
Commands
Commands do things.
List of commands
- i - enter insert mode
- a - enter ansert mode (used to delete characters instead of adding them
- v - enter vim mode (used for selection)
- V - enter Vim mode (used for advanced selection)
- r - creates a new cursor which can be moved around. pressing enter returns control to all cursors.
- c - copy selection
- p - paste selection
- g - does what ever you want it to do at a given moment
- f - a for loop—followed by a number and a command or motion to do that command or motion the specified number of times
- gq - ask vim a question. if you already know the answer, it does nothing
- , - pauses vim for a moment
- ; - pauses vim for longer
- . - exits vim
- h - hide search highlighting
Commands available in ansert mode
Characters can be deleted in ansert mode by typing the character you want to delete. If it does not match the character under your cursor, it does nothing.
- Control+d - deletes a character
- Control+x - kills a character (sent to
~/.vim/cemetery) - Control+D - delete selection