Learning Vim: Beginner advice and lessons learned

by Vasyl Nakvasiuk, 2016

@vaxxxa


Vi

(Bill Joy, 1976)

Vim

(Bram Moolenaar 1991)

Neovim

(Thiago de Arruda, 2014)

Why Vim?


Highly customizable

Runs everywhere

Try something new

Investing in yourself

Feel quite at home

Have fun

Vim modes

Vim modes


Normal mode

Insert mode

Visual mode

Yummy features


Operator + Text object

The DOT command

Operators


  • d – delete (also cut)
  • c – change (delete, then place in insert mode)
  • y – yank (copy)
  • v – visually select

  • gu – make lowercase
  • gU – make uppercase
  • g~ – swap case

Text objects


Text object = prefix + object

Text objects


Text object prefix

  • a – select "a"n object
  • i – select an "inner" object

Text objects


Object

  • w – word
  • W – WORD
  • s – sentence
  • p – paragraph
  • ]   [ – [] block
  • )   (   b – () block
  • >   < – <> block
  • }   {   B – {} block
  • t – tag block
  • '   "   ` – quoted string

Magic commands


NUMBER  +  OPERATOR  +  TEXT OBJECT/MOTION

Magic commands


C I W

D A }

V I T

C I )

Y I "

C A T

D A P

The DOT command

Repeat single motion (last change)

The DOT command

Now you can repeat everything like a boss

Learning curves

Before you start, you should know

Before you start, you should know


Different from everything you've used before

Don't start at work

Don't use arrow keys

Break up with your mouse

Use always a better way

Don't copy someone else's configuration

Don't use 100500 plugins

Find your vim mentor/guru/jedi

Vimtutor


$ vimtutor

:Tutor

Must have plugins


fzf.vim

Must have plugins


NerdTree

Learning Vim is

A process, not an action

Links


Cheatsheets:



Other:

The end


Thank you for attention!

  • Vasyl Nakvasiuk
  • Email: vaxxxa@gmail.com
  • Twitter: @vaxXxa
  • Github: vaxXxa


This presentation:

Source: https://github.com/vaxXxa/talks

Live: http://vaxXxa.github.io/talks