Skip to content

Instantly share code, notes, and snippets.

@timstott
Last active May 21, 2019 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timstott/233a2832cd757cdda03e4c9afffa13f0 to your computer and use it in GitHub Desktop.
Save timstott/233a2832cd757cdda03e4c9afffa13f0 to your computer and use it in GitHub Desktop.
How To Vim

Argument list

Add to the argument list

command outcome
:args ag -l spec_helper add command result to args list

Operate on the argument list

command outcome
:argdo normal @w apply w marco to args list

Formatting

command outcome
gqG in visual mode formats buffer from current position to end of file

Movement

Visual vs Real lines

Vim makes the distinction between real and display line. This comes in handy when lines are wrapped.

command outcome
j down one real line
gj down one display line

Find by character

Only operates on a single line.

command outcome
f{char:c} forward to the next occurrence of c
; repeat
, reverse
F{char:o} backward to the previous occurrence of o

GO TO

command outcome
gf go to file under the curose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment