Skip to content

Instantly share code, notes, and snippets.

@madis
Created October 4, 2012 09:09
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 madis/3832423 to your computer and use it in GitHub Desktop.
Save madis/3832423 to your computer and use it in GitHub Desktop.
Vim findings

Line navigation

  • k - up
  • j - down
  • h - left
  • l - right

Current line, go to:

  • 0 - start
  • ^ - firs non-blank character
  • $ - last non-blank character
  • g_ - last non-blank character

Screen navigation

Following are the three navigation which can be done in relation to text shown in the screen.

  • H – Go to the first line of current screen.
  • M – Go to the middle line of current screen.
  • L – Go to the last line of current screen.
  • ctrl+f – Jump forward one full screen.
  • ctrl+b – Jump backwards one full screen
  • ctrl+d – Jump forward (down) a half screen
  • ctrl+u – Jump back (up) one half screen

Moving between modes

To insert mode

  • i - before current character
  • I - beginning of line
  • a - after current character
  • A - end of line

Useful commands

Command       | What it does
--------------------------------
:set number   | Shows line numbers
:set nonumber | Hide line numbers

Buffers

  • :badd - add buffer (will autocomplete to file names)
  • :bd - (buffer delete) closes current buffer (takes buffer number, name or range, defaults to current)
  • :bw - (buffer wipeout) (takes buffer number, name or range, defaults to current)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment