a1exlism
7/24/2014 - 6:11 PM

Vim Shortcuts

Vim Shortcuts

DescriptionshortcutsDetails
Go to the HeaderHin Screen
Go to the MiddleM
Go to the LowerL
selectvSelection
select row(s)SHIFT + v
select blocks (columns)CTRL + v
search for word under cursor*Pretty Good
split screen horizontally:splitSplit Screens
split screen vertically:vsplit
move down a screenCTRL + w + j
move up a screenCTRL + w + k
move left a screenCTRL + w + h
move right a screenCTRL + w + l
close all other split screens:only
convert selected text to uppercaseUwith Case
convert selected text to lowercaseu
invert case of selected text~

Not support in Atom

Position cursor at middle of screen      zz                                       
Position cursor at top of screen         zt                                       
Position cursor at the bottom of screen  zb                                       

convert tabs to spaces                   :retab
indent selected text                     >
unindent selected text                   <
list buffers                             :ls
open buffer                              :bN (N = buffer number)
print                                    :hardcopy
sort selected rows                       :sort

start recording a macro                  qX (X = key to assign macro to)
stop recording a macro                   q
playback macro                           @X (X = key macro was assigned to)
replay previously played macro *         @@
auto-complete a word you are typing **   CTRL + n
bookmark current place in file           mX (X = key to assign bookmark to)
jump to bookmark                         `X (X = key bookmark was assigned to` = back tick/tilde key)
show all bookmarks                       :marks
delete a bookmark                        :delm X (X = key bookmark to delete)
delete all bookmarks                     :delm!
  • As with other commands in vi, you can playback a macro any number of times. The following command would playback the macro assigned to the key w 100 times: 100@w

  • Vim uses words that exist in your current buffer and any other buffer you may have open for auto-complete suggestions.

References:

Vim commands you wish known earlier

Vim cheatsheet

Vim Commands Cheat Sheet

A handy guide to Vim shortcuts