vim cards - powerpoint format

Post on 26-Dec-2014

1.654 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

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

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

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

diwDelete the current word.

ddDelete the current line.

DDelete to the end of the current line.

dipDelete the current paragraph.

dtqDelete to the next occurrence of the letter q.

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

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

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

PPaste buffer contents before the current cursor position.

pPaste buffer contents after the current cursor position.

rReplace current character.

RReplace continuous characters starting at the current cursor position.

sSubstitute the current character.

SSubstitute the current line.

oOpen a new line below the current line.

OOpen a new line above the current line.

aAppend text after the current position.

AAppend text at the end of the current line.

iInsert text before the current position.

IInsert text at the start of the current line.

uUndo.

ctrl+rredo.

ctrl+psee autocomplete list.

shift+4Move to end of current line.

shift+6Move to start of current line.

ctrl+fMove Forward one screen.

Think Page Down.

ctrl+bMove Backward one screen.

Think Page Up.

ctrl+wCycle focus between open Vim windows.

ctrl+wrSwap window positions.

ctrl+w=Equalize window widths.

gfOpen the file that the cursor is currently on.

Think Go to File.

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

/item returnSearch for the word item.

nMove forward to the next occurrence in a search.

NMove backward to the previous occurrence in a search.

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

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

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

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

:cdChange Directory. Works just like in the terminal.

: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.

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

window.

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

:wWrite to file a.k.a Save.

:wqWrite to file and quit.

top related