Slide 1

Slide 1 text

:vim! theory + practice @jm3

Slide 2

Slide 2 text

:help theory

Slide 3

Slide 3 text

:history bill% ls ~/1976

Slide 4

Slide 4 text

:why vim?

Slide 5

Slide 5 text

:turing-complete

Slide 6

Slide 6 text

:turing-complete

Slide 7

Slide 7 text

any editor will “get you there”

Slide 8

Slide 8 text

Vim is a stick-shift 2 1 3 4 R

Slide 9

Slide 9 text

:taoist view

Slide 10

Slide 10 text

jm3’s “Tao of Vim” • minimal distractions • to know vim is to know unix • in vim, editing is programming • vim is everywhere

Slide 11

Slide 11 text

:beware false-prophets •“don’t use the mouse” •“don’t use the arrow keys” •“use my dotfiles” :) see Yehuda’s “Everyone Who Tried to Convince Me to use Vim was Wrong”

Slide 12

Slide 12 text

:review theory ~ any editor will get you there ~ stick shift ~ tao: + minimalism + to know vim is to know unix + editing is programming + vim is everywhere ~ beware “false prophets”: + mouse == OK, arrow keys are fine

Slide 13

Slide 13 text

:help practice :q :qq :q!Q :1qqZZ!q :WTF how do i get out of here?

Slide 14

Slide 14 text

:basics! launch + save + exit

Slide 15

Slide 15 text

:basics foo.rb :e Edit foo.rb

Slide 16

Slide 16 text

:basics : w Write

Slide 17

Slide 17 text

:basics eXit : x

Slide 18

Slide 18 text

:basics Quit : q

Slide 19

Slide 19 text

:basics w : Write + Quit q

Slide 20

Slide 20 text

:basics Z Z GTFO

Slide 21

Slide 21 text

switching modes…

Slide 22

Slide 22 text

Command Mode Editing Mode two very different modes Esc

Slide 23

Slide 23 text

Sphinx of black quartz, judge my vow! i a o entering Edit mode:

Slide 24

Slide 24 text

Sphinx of black quartz, judge my vow! i a o entering Edit mode:

Slide 25

Slide 25 text

Sphinx of black quartz, judge my vow! i a o entering Edit mode:

Slide 26

Slide 26 text

Sphinx of black quartz, judge my vow! i a o entering Edit mode:

Slide 27

Slide 27 text

Basics review: edit write exit :w :e :x insert append ohhhh a i o

Slide 28

Slide 28 text

:motion!

Slide 29

Slide 29 text

:motion j h k movement l :masochism

Slide 30

Slide 30 text

Remember: word + line + block jump + search

Slide 31

Slide 31 text

:motion w forward word back word b

Slide 32

Slide 32 text

:motion ⏎ line

Slide 33

Slide 33 text

:motion ] forward block backward block [

Slide 34

Slide 34 text

:motion foo / Search

Slide 35

Slide 35 text

:motion foo ? Search backwards

Slide 36

Slide 36 text

:motion Go to line number 10 G

Slide 37

Slide 37 text

:motion G Jump to ”corners” G 1

Slide 38

Slide 38 text

/ Motion review: word + line + block ⏎ w b [ ] jump + search 47 G foo

Slide 39

Slide 39 text

:editing!

Slide 40

Slide 40 text

:editing d delete change c i insert append a

Slide 41

Slide 41 text

Commands stack like LEGOs

Slide 42

Slide 42 text

d w Delete word

Slide 43

Slide 43 text

d w Delete word

Slide 44

Slide 44 text

d 3 Delete 3 words w

Slide 45

Slide 45 text

3 d Delete 3 words w

Slide 46

Slide 46 text

w d 3 Delete 3 words

Slide 47

Slide 47 text

c w Change word

Slide 48

Slide 48 text

c w Change word

Slide 49

Slide 49 text

D Delete line

Slide 50

Slide 50 text

10 D Delete 10 lines

Slide 51

Slide 51 text

D 10 Delete 10 lines

Slide 52

Slide 52 text

foo / d Delete to “foo”

Slide 53

Slide 53 text

foo / d Delete to “foo”

Slide 54

Slide 54 text

foo / d Delete to “foo”

Slide 55

Slide 55 text

:file-slinging!

Slide 56

Slide 56 text

:file-slinging foo.rb :e Edit foo.rb remember this?

Slide 57

Slide 57 text

:file-slinging :e Edit some-dir try this! ~

Slide 58

Slide 58 text

:file-slinging :help NERDTree github.com/tpope/vim-pathogen

Slide 59

Slide 59 text

:magic powers

Slide 60

Slide 60 text

Demo ^ (ctl+6) toggle + jump between buffers list buffers with :ls jump with 1^

Slide 61

Slide 61 text

Demo recent files toggle previous file

Slide 62

Slide 62 text

Demo tab complete anything SuperTab git://github.com/ervandew/supertab

Slide 63

Slide 63 text

Demo Tabular git://github.com/godlygeek/tabular alignment

Slide 64

Slide 64 text

Demo outline mode Markdown-Folding git://github.com/nelstrom/vim-markdown-folding

Slide 65

Slide 65 text

Demo keep your place set cursorline

Slide 66

Slide 66 text

Demo balance braces %

Slide 67

Slide 67 text

Demo jsHint highlight JS errors on save git://github.com/Shutnik/jshint2.vim

Slide 68

Slide 68 text

Demo highlight syntax colorscheme solarized * first thing I wanted in a text editor

Slide 69

Slide 69 text

Demo Vim-Plug + Vundle + pathogen

Slide 70

Slide 70 text

:wq! @jm3 github.com/jm3/dotfiles