Vim Shortcuts

- Julia Gao @ryoia

(Follow bait)

Speed improvement

Gives developers satisfaction

Does not mess up our train of thoughts

(You are in a terminal anyway)

Why?

Why not Emacs, Sublime, Atom, etc...

This talk is about:

- Vim shortcuts

 

Not about:

- Vim vs Emacs vs ...

Shortcuts

Important Ones

"i" : insert mode

"esc" : normal mode

":q" : quit current vim window

":w" : write/save current vim window

To Move Around:

 

h/j/k/l: left/down/up/right

Insert mode: typing on the screen

Normal mode: typing = commands

Nice-to-have shortcuts

A (Shift + a): Cursor move to the end of the line (insert mode)

I (Shift + i): Cursor move to the beginning of the line (insert)

gg: move to the beginning of the entire file

G (Shift + g): move to the last line of the entire file

:<line-number> : go to a specific line

yy: copy current line (regardless of the position of cursor)

y: copy whatever is selected

p: paste whatever is copied

dd: delete current line

d: delete whatever is selected

v: visual mode (selected)

V(Shift + v): select the current line

f: find

 

Example: 

const rando = 4; (imagine cursor is right before the "="

"vf;" = "visual find ;", will select from wherever the cursor is to ";"

= : format

Shift + v + = : format current line

gg=G : format the entire file

Efficiency

Made with Slides.com