Skip to content

Instantly share code, notes, and snippets.

@ggsalas
Last active February 16, 2017 00:22
Show Gist options
  • Save ggsalas/bf9adfd1dd080ff4c0f01a6e52a6e4f6 to your computer and use it in GitHub Desktop.
Save ggsalas/bf9adfd1dd080ff4c0f01a6e52a6e4f6 to your computer and use it in GitHub Desktop.
Simple way to use Vim

Vim Usage

  • Verbs could be use in conjunction with objects, for example: ciw that means Change In a Word.
  • Also, the verbs could be use in conjunction with numbers to multiply the action, for example: d2+ => delete 2 lines down.
Verbs Objects
d => Delete iw => Inner Word
c => Change it => Inner Tag
> => indent i" => Inner quotes
v => Visually select ip => Inner Paragraph
y => Yank (copy) as => A Sentence
Parametrized Objects
f, F => Find the next character
t, T => Same to f, bit without last character
/ => Same, but with a find (without include)

Navigation

  • 0, $ => start, en of the line (^, g_, go to: first, last char of the line)

  • w, e, b => Word End and Back movments (capitalize for Big Word)

  • % => go to matching parenthesis

  • I => insert on left, insert on left of the line

  • A => insert on right, insert on right of the line

  • H, L, M => go to: Hight, Lower, Middle of the screen

  • gg, G, 2gg => go to: line 0, end line, line 2

  • zt, zz, zb => scroll current line to: top, center, bottom

  • ctrl+y, ctrl+e => scroll one line to: top, bottom

  • ctrl+u, ctrl+d => scroll half page to: up, down

  • ctrl+b, ctrl+f => scroll full page to: forward, back

Search

  • *, # => find next word under the cursor, back
  • /, n, N => search, next, previous
  • vimgrep 'searchTxt' **/*.php => search
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment