Skip to content

Instantly share code, notes, and snippets.

@a1exlism
Last active March 28, 2018 08:06
Show Gist options
  • Save a1exlism/d2922730f554b99ca9b1d49b0c662643 to your computer and use it in GitHub Desktop.
Save a1exlism/d2922730f554b99ca9b1d49b0c662643 to your computer and use it in GitHub Desktop.
Vim Shortcuts
Description shortcuts Details
Go to the Header H in Screen
Go to the Middle M
Go to the Lower L
select v Selection
select row(s) SHIFT + v
select blocks (columns) CTRL + v
search for word under cursor * Pretty Good
split screen horizontally :split Split Screens
split screen vertically :vsplit
move down a screen CTRL + w + j
move up a screen CTRL + w + k
move left a screen CTRL + w + h
move right a screen CTRL + w + l
close all other split screens :only
convert selected text to uppercase U with Case
convert selected text to lowercase u
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment