Intro To Vim
Everyone's First Vim Session
^C^C^X^X^X^XquitqQ!qdammit[esc]qwerty uiopasdfghjkl;:xwhat
But how can we avoid this
- vimtutor - command line tutorial
- VIM Adventures
- This Cheat Sheet - or many others
- Focus on five commands a week
You will probably still struggle
- Copy and paste
- Not using the mouse
- Getting to the end of the line
Vim has modes
- Such as:
- normal
- insert
- visual
- command-line
- Higher complexity, but comes with incredible power
You can move around
- The bare minimum
- h, j, k, l
- Do not use the arrow keys
- Get around the screen faster
- H, M, L, gg, G, :50
And do things
- i - insert
- d - delete
- y - yank, p - paste
- Copy and paste - sort of
- c - change
- like selecting text and typing over it
On objects
- obvious
- w - word, line
- logical
- p - paragraph, s - sentence
- useful
- blocks of all sorts (t-html, various symbols)
That can be modified
- i - inside
- a - around
- t - (un)till
- f - find
And finally combined into a language
- Basic things
- 3j - down three lines
- d3j - delete the current and the next three lines
- d3k - delete the current and the previous three lines
- And more advanced ones
- c$ - change until the end of the line
- das - delete around sentence
- ci" - change inside quotes
- dit - delete inside html blocks (<b>test</b>)
Demonstration
Other talks
- Write Code Faster: Expert Level Vim by Ben Orenstein
- More Instantly Better Vim by Damian Conway
- Impressive Ruby productivity With Vim and Tmux by Chris Hunt
Resources
- These Slides
-
My vimrc
- but I recommend starting with a blank
Try Vim for yourself
Intro to Vim
By Andrew Tomaka
Intro to Vim
- 914