vim cards - powerpoint format

48

Upload: adam-lowe

Post on 26-Dec-2014

1.654 views

Category:

Technology


2 download

DESCRIPTION

Slide deck for memorizing the Vim commands that I've found most useful over my first few months as a Vim user.This was purposefully kept free of any styling etc as this is the actual deck I use for memorization and don't like distractions.

TRANSCRIPT

Page 1: Vim Cards - Powerpoint Format
Page 2: Vim Cards - Powerpoint Format

dhDelete the letter the cursor is currently on and move left.

Page 3: Vim Cards - Powerpoint Format

dlDelete the letter the cursor is currently on and move right.

Page 4: Vim Cards - Powerpoint Format

diwDelete the current word.

Page 5: Vim Cards - Powerpoint Format

ddDelete the current line.

Page 6: Vim Cards - Powerpoint Format

DDelete to the end of the current line.

Page 7: Vim Cards - Powerpoint Format

dipDelete the current paragraph.

Page 8: Vim Cards - Powerpoint Format

dtqDelete to the next occurrence of the letter q.

Page 9: Vim Cards - Powerpoint Format

Note:When you delete something in Vim it is like cut in other editors. What you delete is then available in the buffer to be pasted.

The buffer and your clipboard are not the same entity. To paste from the clipboard use ⌘v on OS X or on other systems use “+p or “*p

Page 10: Vim Cards - Powerpoint Format

yip“Yank” or copy the current paragraph to Vim’s buffer.

Page 11: Vim Cards - Powerpoint Format

yy“Yank” or copy the current line to Vim’s buffer.

Page 12: Vim Cards - Powerpoint Format

PPaste buffer contents before the current cursor position.

Page 13: Vim Cards - Powerpoint Format

pPaste buffer contents after the current cursor position.

Page 14: Vim Cards - Powerpoint Format

rReplace current character.

Page 15: Vim Cards - Powerpoint Format

RReplace continuous characters starting at the current cursor position.

Page 16: Vim Cards - Powerpoint Format

sSubstitute the current character.

Page 17: Vim Cards - Powerpoint Format

SSubstitute the current line.

Page 18: Vim Cards - Powerpoint Format

oOpen a new line below the current line.

Page 19: Vim Cards - Powerpoint Format

OOpen a new line above the current line.

Page 20: Vim Cards - Powerpoint Format

aAppend text after the current position.

Page 21: Vim Cards - Powerpoint Format

AAppend text at the end of the current line.

Page 22: Vim Cards - Powerpoint Format

iInsert text before the current position.

Page 23: Vim Cards - Powerpoint Format

IInsert text at the start of the current line.

Page 24: Vim Cards - Powerpoint Format

uUndo.

Page 25: Vim Cards - Powerpoint Format

ctrl+rredo.

Page 26: Vim Cards - Powerpoint Format

ctrl+psee autocomplete list.

Page 27: Vim Cards - Powerpoint Format

shift+4Move to end of current line.

Page 28: Vim Cards - Powerpoint Format

shift+6Move to start of current line.

Page 29: Vim Cards - Powerpoint Format

ctrl+fMove Forward one screen.

Think Page Down.

Page 30: Vim Cards - Powerpoint Format

ctrl+bMove Backward one screen.

Think Page Up.

Page 31: Vim Cards - Powerpoint Format

ctrl+wCycle focus between open Vim windows.

Page 32: Vim Cards - Powerpoint Format

ctrl+wrSwap window positions.

Page 33: Vim Cards - Powerpoint Format

ctrl+w=Equalize window widths.

Page 34: Vim Cards - Powerpoint Format

gfOpen the file that the cursor is currently on.

Think Go to File.

Page 35: Vim Cards - Powerpoint Format

ctrl+wgfOpen file at current cursor position in new tab.

Page 36: Vim Cards - Powerpoint Format

/item returnSearch for the word item.

Page 37: Vim Cards - Powerpoint Format

nMove forward to the next occurrence in a search.

Page 38: Vim Cards - Powerpoint Format

NMove backward to the previous occurrence in a search.

Page 39: Vim Cards - Powerpoint Format

:s/new/old/gSubstitute the word “new” for the word “old” on the current line.

Page 40: Vim Cards - Powerpoint Format

:%s/new/old/gSubstitute the word “new” for the word “old” on the current document.

Page 41: Vim Cards - Powerpoint Format

:spSplit the current window in order to view two parts of the same file simultaneously.

Page 42: Vim Cards - Powerpoint Format

:pwdPrint Working Directory. Lists the Vim’s current directory within the file system.

Page 43: Vim Cards - Powerpoint Format

:cdChange Directory. Works just like in the terminal.

Page 44: Vim Cards - Powerpoint Format

:e ~/path/file.nameEdit the file name at the given path.

When given for a file that does not exist yet it will be stored in the buffer and created when you Write.

Page 45: Vim Cards - Powerpoint Format

:Se ~/path/file.nameEdit a file in a horizontally split

window.

Page 46: Vim Cards - Powerpoint Format

:Ve ~/path/file.nameEdit a file in a vertically split window.

Page 47: Vim Cards - Powerpoint Format

:wWrite to file a.k.a Save.

Page 48: Vim Cards - Powerpoint Format

:wqWrite to file and quit.