Download - Vim From Essentials to Mastery 2011
![Page 1: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/1.jpg)
VimFrom Essentials to MasteryTools, Techniques, and Configuration for the Vim Text Editor
Bill Odom ([email protected]) • vimgeeks.org
![Page 2: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/2.jpg)
![Page 3: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/3.jpg)
![Page 4: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/4.jpg)
![Page 5: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/5.jpg)
![Page 6: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/6.jpg)
![Page 7: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/7.jpg)
![Page 8: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/8.jpg)
A Quick History Lesson...
![Page 9: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/9.jpg)
What is Vim?
![Page 10: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/10.jpg)
Modal Text Editor
![Page 11: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/11.jpg)
Built by Bram Moolenar...
![Page 12: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/12.jpg)
![Page 13: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/13.jpg)
![Page 14: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/14.jpg)
Based on vi...
![Page 15: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/15.jpg)
...created by Bill Joy...
![Page 16: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/16.jpg)
![Page 17: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/17.jpg)
...in 1976.
![Page 18: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/18.jpg)
19761976
![Page 19: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/19.jpg)
So why bother?
![Page 20: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/20.jpg)
The Sales Pitch
![Page 21: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/21.jpg)
Multi-Language
![Page 22: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/22.jpg)
![Page 23: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/23.jpg)
Multi-Interface
![Page 24: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/24.jpg)
![Page 25: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/25.jpg)
![Page 26: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/26.jpg)
Multi-Platform
![Page 27: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/27.jpg)
![Page 28: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/28.jpg)
![Page 29: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/29.jpg)
![Page 30: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/30.jpg)
![Page 31: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/31.jpg)
![Page 32: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/32.jpg)
![Page 33: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/33.jpg)
![Page 34: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/34.jpg)
![Page 35: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/35.jpg)
Active Community
![Page 36: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/36.jpg)
![Page 37: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/37.jpg)
Ridiculously Powerful
![Page 38: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/38.jpg)
Ridiculously Configurable
![Page 39: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/39.jpg)
Open Source
![Page 40: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/40.jpg)
Good for You
![Page 41: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/41.jpg)
Good for Orphans:help uganda
![Page 42: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/42.jpg)
![Page 43: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/43.jpg)
The Fine Print...
![Page 44: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/44.jpg)
Classical learning curves
for some common editors
Notepad pico
Visual Studio vi emacs
![Page 45: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/45.jpg)
vi
![Page 46: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/46.jpg)
and yet...
![Page 47: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/47.jpg)
![Page 48: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/48.jpg)
The Sales Pitch✓
![Page 49: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/49.jpg)
So why bother?
Save Time
Increase Productivity
Reduce Tedium
Remain Sane
Have Fun
![Page 50: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/50.jpg)
Use a single editor well.
The editor should be an extension of your hand;make sure your editor is configurable, extensible, and programmable.
—The Pragmatic Programmerby Andrew Hunt and David Thomas
![Page 51: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/51.jpg)
Goals
![Page 52: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/52.jpg)
How to Get Started
![Page 53: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/53.jpg)
A Few Big Ideas
![Page 54: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/54.jpg)
Lots of Tips
![Page 55: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/55.jpg)
Discussion, QuestionsComments
![Page 56: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/56.jpg)
Non-Goals
![Page 57: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/57.jpg)
![Page 58: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/58.jpg)
“Escape Meta Alt Control Shift”
![Page 59: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/59.jpg)
“Emacs: A great operating“system, lacking only a“decent editor.”
![Page 60: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/60.jpg)
vi has two modes:“beep repeatedly” and “break everything”
![Page 61: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/61.jpg)
Sometimes, people ask me if it is a sin in the church of Emacs to use the editor Vi. It is true that Vi-Vi-Vi is the editor of the beast. But using a free version of Vi is not a sin but a penance.
— Richard Stallman (creator of EMACS)
![Page 62: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/62.jpg)
![Page 63: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/63.jpg)
Getting Started
![Page 64: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/64.jpg)
Step One: Don’t
![Page 65: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/65.jpg)
![Page 66: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/66.jpg)
![Page 67: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/67.jpg)
A small piece of advice:Don’t try to do it all at once.
Get a good version of vi that doesn't make you abandon everything you already know—then slowly, steadily build up your repertoire of magic tricks...
![Page 68: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/68.jpg)
I’ve been using some form of vi for years, and I still learn new stuff all the time. Frankly, that’s part of its appeal—it’s as deep as I want to go, and there’s more power every time I take a few minutes to learn it.
– from an email exchange between Bill Odom and Merlin Mann
![Page 69: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/69.jpg)
You should not try to learn every command an editor offers. That would be a complete waste of time. Most people only need to learn 10 to 20 percent of the commands for their work. But it’s a different set of commands for everybody.
—Bram Moolenar
![Page 70: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/70.jpg)
I am amzedf at how mcuh easier it is to use vim when I jhave had a few beers. The modal commands just seem to flow from my fgingertips.
—Bill Odom (from “vim beer amazement.txt”)
![Page 71: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/71.jpg)
![Page 72: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/72.jpg)
Getting Vim
![Page 73: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/73.jpg)
UNIX or Linux?Done.
![Page 74: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/74.jpg)
Mac OS X:code.google.com/p/macvim/
![Page 75: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/75.jpg)
![Page 76: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/76.jpg)
Everybody else:www.vim.org/download.php
![Page 77: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/77.jpg)
Getting Help
:help (or just :h)
:help :help
:helpgrep (or just :helpg)
:help!
:h 42
:h holy-grail
![Page 78: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/78.jpg)
![Page 79: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/79.jpg)
![Page 80: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/80.jpg)
Modes
![Page 81: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/81.jpg)
A Whole Lotta Modes
Insert Mode
Normal Mode
Command Mode
Visual Mode
Select Mode
Ex Mode
Operator-pending Mode
Replace Mode
Virtual Replace Mode
Insert Normal Mode
Insert Visual Mode
Insert Select Mode
![Page 82: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/82.jpg)
A Whole Lotta Modes
Insert Mode
Normal Mode
Command Mode
Visual Mode
![Page 83: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/83.jpg)
Insert Mode
Typical text entry and basic editing
Arrow keys (and mouse) work
Lots of ways to get there...
![Page 84: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/84.jpg)
Insert Mode
i a c o r s
I A C O R S
![Page 85: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/85.jpg)
Insert Mode
<Esc> to get out
<C-O> to temporarily get out
![Page 86: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/86.jpg)
Normal Mode
Moving around
More complex editing
Default mode
![Page 87: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/87.jpg)
Moving Around
kh • l j
![Page 88: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/88.jpg)
Moving Around
H M L
gg
123G
:123
![Page 89: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/89.jpg)
Moving Around
Many more advanced motions available
But the arrow keys & mouse still work!
![Page 90: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/90.jpg)
Moving Around
gj
gk
![Page 91: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/91.jpg)
Traveling Without Moving
![Page 92: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/92.jpg)
Traveling Without Moving
zz
zt
zb
![Page 93: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/93.jpg)
Traveling Without Moving
:let &scrolloff=999-&scrolloff
![Page 94: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/94.jpg)
Instant Searches
*
#
g*
g#
![Page 95: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/95.jpg)
Completion
<C-N>
<C-P>
<C-X><C-…>
![Page 96: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/96.jpg)
![Page 97: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/97.jpg)
Command-Line Mode
Ex commands
Search commands
Filter commands
![Page 98: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/98.jpg)
Visual Mode
![Page 99: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/99.jpg)
What?
Visual mode is a flexible and easy way to select a piece of text for an operator.
— :help visual-mode
![Page 100: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/100.jpg)
Why use it?
Simple way to select text and operate on it
Often faster (and easier) than other methods
Sometimes it’s the only way to indicate an arbitrary block of text
![Page 101: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/101.jpg)
Three Modes in One!
Visual
Visual Line
Visual Block
![Page 102: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/102.jpg)
Three Modes in One!
Visual - characterwise
Visual Line - linewise
Visual Block - er... rectanglewise
![Page 103: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/103.jpg)
Getting There
v for Visual
V for Visual Line
<C-V> for Visual Block
![Page 104: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/104.jpg)
Getting Out
![Page 105: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/105.jpg)
Defining the Visual Area
Enter Visual mode
Move around
...or use a text object
...or a search
...or even a mouse
![Page 106: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/106.jpg)
Doing Stuff
Define a visual area
Use an operator
...or an Ex command
![Page 107: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/107.jpg)
Visual Operators
All the usual suspects:
~ d c y > < ! = gq
...and a bunch more:
r s C S R x D
X Y p J U u ^] I
![Page 108: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/108.jpg)
Oops, Wrong Mode
No problem
Switch among modes with
v, V, or <C-V>
Start and end points are preserved
![Page 109: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/109.jpg)
Oops, Wrong Spot
Started in the wrong place?
Toggle between start end end with o(lowercase o)
![Page 110: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/110.jpg)
Oops, Wrong Corner
For Visual Blocks
Need to move the other side?
Switch to the other corner with O(uppercase O)
![Page 111: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/111.jpg)
o.O
![Page 112: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/112.jpg)
Prepending Text in a Block
Define a Visual Block
Press I (“Insert at beginning”)
Type the text to be prepended
Hit Escape
Works in the middle of a block, too
![Page 113: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/113.jpg)
Appending Text in a Block
Define a Visual Block
Press A (“Append”)
Type the text to be appended
Hit Escape
![Page 114: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/114.jpg)
Appending Text in a Block
Start a Visual Block
...but press $ to move to the end of a line
Press A (for “Append”)
Type the text to be appended
Hit Escape
Text is appended to each line, sensitive to the length
![Page 115: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/115.jpg)
Example Maps" Backspace in Visual mode deletes selection."vnoremap <BS> d
" Tab/Shift+Tab indent/unindent the highlighted" block (and maintain the highlight after changing" the indentation). Works for both Visual and" Select modes."vnoremap <Tab> >gvvnoremap <S-Tab> <gv
![Page 116: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/116.jpg)
Example Maps
" Join all lines in a paragraph"nnoremap <S-F7> vipJ
" Format selected lines"xnoremap Q gq
![Page 117: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/117.jpg)
Visual Key Map Gotchas
Watch out for :vmap
Prefer :xmap and :smap where possible
![Page 118: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/118.jpg)
Example Tricks
Count bytes in an arbitrary selection
See text objects
Draw boxes
Abuse indentation
Filter a visual range
![Page 119: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/119.jpg)
Important Settings
virtualedit
selectmode
keymodel
mouse
![Page 120: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/120.jpg)
Important Settings
:set virtualedit=block
:set selectmode=key,mouse
:set keymodel=startsel,stopsel
:set mouse=a
![Page 121: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/121.jpg)
Useful Help Topics
:help visual-mode
:help v_...
:help v_b_...
![Page 122: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/122.jpg)
![Page 123: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/123.jpg)
Core Configuration
![Page 124: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/124.jpg)
The Usual Suspects
.vimrc
.gvimrc
~/.vim/
![Page 125: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/125.jpg)
Strict vi Compatibility?
:set nocompatible
![Page 126: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/126.jpg)
Extensions
:filetype plugin indent on
![Page 127: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/127.jpg)
Backups and Swapfiles
:set backupdir-=.:set backupdir^=~/tmp,/tmp:set directory=~/tmp//,.
![Page 128: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/128.jpg)
Backups and Swapfiles
:set backupdir-=.:set backupdir^=$TEMP:set directory=$TEMP\\\\
![Page 129: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/129.jpg)
:set incsearch:set hlsearch:set ignorecase:set smartcase
Easier Searching
![Page 130: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/130.jpg)
:set tabstop=4:set softtabstop=4:set expandtab:set smarttab
Controlling Whitespace
![Page 131: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/131.jpg)
Controlling Whitespace
:set shiftwidth:set shiftround
![Page 132: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/132.jpg)
Roam If You Want To
:set backspace=indent,eol,start
:set whichwrap+=<,>,[,]
![Page 133: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/133.jpg)
Better Buffers
:set hidden
![Page 134: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/134.jpg)
Blessed Silence
:set vb:set t_vb=
![Page 135: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/135.jpg)
![Page 136: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/136.jpg)
Operators
c
d
y
~
g~
gu
gU
!
=
gq
g?
>
<
zf
g@
![Page 137: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/137.jpg)
Operators
:help operator
![Page 138: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/138.jpg)
Motions
h j k l
gj gk
0 ^ $
g0 g^ g$ g_
f F t T
w W e E
b B ge gE
- +
( ) { }
]] ][ [[
| _ %
![Page 139: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/139.jpg)
Motions
:help motion.txt
![Page 140: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/140.jpg)
Text Objects
w - Words
W - WORDs
s - Sentences
p - Paragraphs
t - Tagged blocks
Blocks delimited by [] () {} <>
Strings delimited by " ' `
![Page 141: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/141.jpg)
Text Objects
:help text-objects
![Page 142: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/142.jpg)
Ranges
Line numbers (absolute or symbolic)
Marks (manual or automatic)
Search patterns (forward or backward)
![Page 143: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/143.jpg)
Ranges
:help cmdline-ranges
![Page 144: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/144.jpg)
![Page 145: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/145.jpg)
Registers
![Page 146: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/146.jpg)
What’s a Register?
Stores a chunk of text
Like the system clipboard
But much more flexible
![Page 147: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/147.jpg)
The Unnamed Register
You already use this one
The one you get if you don’t specify
Target of typical delete, yank, and put operations (a.k.a. cut, copy, and paste)
![Page 148: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/148.jpg)
Simple Registers
26 named registers
Accessed as "a through "z
![Page 149: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/149.jpg)
Appending to Registers
Deletes and yanks overwrite registers
But they don’t have to
Uppercase the name to append instead
![Page 150: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/150.jpg)
Numbered Registers
You don’t always have to be explicit
Vim tracks recent deletes
Look in "1 through "9
![Page 151: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/151.jpg)
Other Registers
Current filename:
"%
Alternate filename:
"#
![Page 152: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/152.jpg)
Other Registers
Last “small” delete:
"-
Last inserted text:
".
![Page 153: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/153.jpg)
Other Registers
Last search:
"/
Last Ex command:
":
![Page 154: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/154.jpg)
Other Registers
Expression:
"=
(Lots more on this one later)
![Page 155: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/155.jpg)
Other Registers
System clipboard:
"*
System Selection (X11):
"+
![Page 156: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/156.jpg)
Other Registers
Black hole:
"_
![Page 157: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/157.jpg)
Viewing Registers
View with :registers
Or just :reg
View specific registers with :reg abc
![Page 158: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/158.jpg)
Accessing Registers
Normal mode:
"<register><operator>
![Page 159: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/159.jpg)
Accessing Registers
Visual mode:
"<register><operator>
![Page 160: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/160.jpg)
Accessing Registers
Insert mode and command line:
<C-R><register>
<C-R><C-R><register>
<C-R><C-O><register>
<C-R><C-P><register>
![Page 161: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/161.jpg)
Accessing Registers
Ex commands and scripts:
@<register>
![Page 162: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/162.jpg)
Registers == Macros
Execute in Normal mode:
@<register>
![Page 163: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/163.jpg)
Registers == Ex Commands?
Execute in Command mode:
:@<register>
![Page 164: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/164.jpg)
Clearing Registers
Assign on the command line:
:let @a = ""
Record an empty macro:
qaq
![Page 165: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/165.jpg)
Expression Register
Value is the result of an expression
Can be used interactively or in scripts
Accessed as "= or @= or \= depending on context
![Page 166: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/166.jpg)
Expression Register Example
inoremap <F2>
<C-R>=strftime("%c")<CR>
![Page 167: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/167.jpg)
Expression Register Example
:cnoremap <C-G>
<C-R><C-R>=
GetLiteralPattern()
<CR>
![Page 168: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/168.jpg)
Expression Register Example
:xnoremap \/
"vy/
<C-R><C-R>
=StringToPattern(@v)
<CR>
![Page 169: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/169.jpg)
Tips & Tricks
Copy to the OS clipboard:
"*yy
![Page 170: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/170.jpg)
Tips & Tricks
Paste from the OS clipboard:
"*p
(Can be more reliable than pasting through a terminal window.)
![Page 171: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/171.jpg)
Tips & Tricks
Link unnamed register and OS clipboard:
:set clipboard=unnamed
![Page 172: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/172.jpg)
Tips & Tricks
Pre-load in .vimrc:
:let @a = "123 Main Street"
:let @p = "800-555-1212"
![Page 173: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/173.jpg)
Tips & Tricks
“Search” for text without moving cursor:
:let @/ = "stuff"
![Page 174: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/174.jpg)
Tips & Tricks
Execute accidentally-inserted command:
<Esc>u:@.
![Page 175: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/175.jpg)
Tips & Tricks
Edit a macro:
"mp
...edit macro text...
"myy
![Page 176: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/176.jpg)
Tips & Tricks
Combine several registers:
:let @* = @a . @b . @c
![Page 177: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/177.jpg)
Tips & Tricks
Capture output to a register:
:redir @A
![Page 178: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/178.jpg)
Tips & Tricks
Yank matching lines into a register:
:g/pattern/y A(Note uppercase register name)
![Page 179: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/179.jpg)
Register Help
:help registers
:help copy-move
![Page 180: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/180.jpg)
Register Help
:help i_CTRL-R
:help i_CTRL-R_CTRL-R
:help i_CTRL-R_CTRL-O
:help i_CTRL-R_CTRL-P
![Page 181: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/181.jpg)
![Page 182: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/182.jpg)
Vim as Language
![Page 183: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/183.jpg)
![Page 184: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/184.jpg)
![Page 185: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/185.jpg)
Verbs:Operators & Commands
![Page 186: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/186.jpg)
d
![Page 187: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/187.jpg)
Subjects:Motions & Text Objects
![Page 188: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/188.jpg)
dj
![Page 189: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/189.jpg)
Adjectives:Ranges & Repetition
![Page 190: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/190.jpg)
d10j
![Page 191: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/191.jpg)
Objects:Registers
![Page 192: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/192.jpg)
“xd10j
![Page 193: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/193.jpg)
Examples
![Page 194: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/194.jpg)
0y$
![Page 195: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/195.jpg)
yy
![Page 196: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/196.jpg)
gg=G
![Page 197: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/197.jpg)
“adG
![Page 198: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/198.jpg)
gqapvipJ
![Page 199: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/199.jpg)
![Page 200: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/200.jpg)
![Page 201: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/201.jpg)
vat
![Page 202: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/202.jpg)
“ayis
![Page 203: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/203.jpg)
kyyp^v$r=ja
![Page 204: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/204.jpg)
![Page 205: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/205.jpg)
![Page 206: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/206.jpg)
![Page 207: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/207.jpg)
Macros
Record and repeat a series of keystrokes
Can be assigned to registers a to z
Run with @a
Repeat last macro with @@
![Page 208: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/208.jpg)
Abbreviations
iabbrev for Insert Mode
cabbrev for Command-Line Mode
abbrev for both
Best for content expansion (vs. behavior)
![Page 209: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/209.jpg)
Key Mapping
![Page 210: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/210.jpg)
What?
Bind a series of keystrokes to a key sequence
Better for defining behavior (vs. abbreviations)
Better for long-term customization(vs. macros)
Can be defined across all of Vim’s modes
Fundamental to customizing Vim
![Page 211: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/211.jpg)
{cmd} {attr} {lhs} {rhs}map command attributes left-hand side right-hand side
Map Command Structure
![Page 212: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/212.jpg)
Map Command Structure
" Example map commandmap <silent> <F2> :echo 'Hello!'<CR>
![Page 213: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/213.jpg)
Map Commands
nmapimapvmapxmapsmap
omapcmaplmapmapmap!
![Page 214: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/214.jpg)
Map Commandsnnoremapinoremapvnoremapxnoremapsnoremaponoremapcnoremap
![Page 215: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/215.jpg)
Map Commandsnnoremapinoremapvnoremapxnoremapsnoremaponoremapcnoremap
![Page 216: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/216.jpg)
Map Attributes
<silent><buffer><expr><unique><script><special>
![Page 217: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/217.jpg)
Available Keys
Function keys and shifted function keys
<Leader> and <LocalLeader> sequences (especially in plugins and scripts)
![Page 218: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/218.jpg)
Sorta-Available Keys
Alt / Option / Meta Keys (safest in the GUI)
Commands you don’t use
Command “synonyms” you don’t use
Comma
Semicolon
Underscore
![Page 219: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/219.jpg)
Finding Keys to Map
:help map-which-keys
:help index.txt
:help {key}
![Page 220: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/220.jpg)
Displaying Maps
:nmap
:nmap {key}
:mkvimrc ~/scratch.vim
![Page 221: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/221.jpg)
Removing Maps
:unmap {key}
:verbose map {key}
![Page 222: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/222.jpg)
" Overload Control+L to also clear" search highlighting"nnoremap <C-L> :nohlsearch<CR><C-L>
Sample Maps
![Page 223: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/223.jpg)
" Toggle screen wrapping of long lines," then display value of ‘wrap’ option"nnoremap <Leader>w\ :set invwrap<Bar>set wrap?<CR>
Sample Maps
![Page 224: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/224.jpg)
" Make up/down arrows move by display" lines instead of physical lines"nnoremap <Up> gknnoremap <Down> gj
Sample Maps
![Page 225: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/225.jpg)
" Reformat current paragraph" nnoremap Q gqap
Sample Maps
![Page 226: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/226.jpg)
" Indent/unindent highlighted block" (and maintain highlight)"vnoremap <Tab> >gvvnoremap <S-Tab> <gv
Sample Maps
![Page 227: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/227.jpg)
" Disable paste-on-middle-click"inoremap <MiddleMouse> <Nop>
Sample Maps
![Page 228: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/228.jpg)
" Center display line after searches"nnoremap n nzznnoremap N Nzznnoremap * *zznnoremap # #zznnoremap g* g*zznnoremap g# g#z
Sample Maps
![Page 229: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/229.jpg)
" Edit vimrc in new tab"nnoremap ,ev :tabedit $MYVIMRC<CR>
Sample Maps
![Page 230: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/230.jpg)
" Delete to end of line, bash-style"inoremap <C-K> <C-O>D
Sample Maps
![Page 231: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/231.jpg)
" Control+Up/Down move lines & selections up and down." (Based on http://vim.wikia.com/wiki/VimTip646)" " Define maps for Normal and Visual modes, then re-use" them for Insert and Select modes."nnoremap <silent> <C-Up> :move -2<CR>nnoremap <silent> <C-Down> :move +<CR>xnoremap <silent> <C-Up> :move '<-2<CR>gvxnoremap <silent> <C-Down> :move '>+<CR>gvimap <silent> <C-Up> <C-O><C-Up>imap <silent> <C-Down> <C-O><C-Down>smap <silent> <C-Up> <C-G><C-Up><C-G>smap <silent> <C-Down> <C-G><C-Down><C-G>
Sample Maps
![Page 232: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/232.jpg)
$VIMRUNTIME/mswin.vim
![Page 233: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/233.jpg)
:vmap <Tab> >gv:vmap <S-Tab> <gv
![Page 234: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/234.jpg)
:nnoremap <F7> gqap:nnoremap <S-F7> vipJ
![Page 235: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/235.jpg)
![Page 236: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/236.jpg)
(and Files(and Buffers(and Windows(and Tabs and Instances
![Page 237: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/237.jpg)
Definitions:
![Page 238: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/238.jpg)
File
Um... a file
![Page 239: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/239.jpg)
Buffer
Usually associated with a file, but doesn’t have to be
Usually has a name, but doesn’t have to
Doesn’t have to be visible
Several different types(that you mostly don’t have to care about)
![Page 240: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/240.jpg)
Window
Displays the contents of a buffer
Always at least one window open
More than one window can display the same buffer
![Page 241: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/241.jpg)
Tab
A group of windows
Not like tabs in other editors
Sometimes called “tab pages”
Better name might be “layout” or “viewport”
![Page 242: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/242.jpg)
Buffers, Windows, Tab Pages
Often confused for one another
A buffer is the contents of a (potential) file
A window is a place where a buffer can be viewed
A tab page is a collection of windows
A buffer can be viewed in any number of windows
![Page 243: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/243.jpg)
Instance
A single running copy of Vim
GUI or terminal
Doesn’t share (well) with other Vim instances
![Page 244: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/244.jpg)
Loading Multiple Files
vim *.sh
vim foo.txt bar.txt baz.txt
vim -o widget.c header.h
vim -p widget.c header.h
![Page 245: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/245.jpg)
Loading Multiple Files
:edit foo.txt
:args *.sh
:args foo.txt bar.txt baz.txt
The args list is modifiable with:argadd and:argdel
![Page 246: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/246.jpg)
Moving Among Buffers
:set hidden
:ls
:b N
:b name
:bfirst :blast :bnext :bprev
<C-^>
![Page 247: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/247.jpg)
Closing Buffers
:bdelete
:bd N
:bd name
:bd!
![Page 248: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/248.jpg)
Buffer Settings
hidden
switchbuf
![Page 249: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/249.jpg)
Buffer Commands
:ball
:bufdo
![Page 250: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/250.jpg)
Creating Windows
:split
:vsplit
<C-W> s
<C-W> v
![Page 251: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/251.jpg)
Moving Between Windows
<C-W> h
<C-W> j
<C-W> k
<C-W> l
![Page 252: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/252.jpg)
Moving Between Windows
<C-W> p
<C-W> <C-W>
![Page 253: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/253.jpg)
Resizing Windows
<C-W> +
<C-W> -
<C-W> <
<C-W> >
...or just use the mouse
![Page 254: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/254.jpg)
Resizing Windows
<C-W> =
<C-W> _
<C-W> |
![Page 255: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/255.jpg)
Moving Windows
<C-W> H
<C-W> J
<C-W> K
<C-W> L
<C-W> x
![Page 256: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/256.jpg)
Closing Windows
:q
<C-W> c
:hide
![Page 257: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/257.jpg)
Closing Other Windows
:only
<C-W> o
![Page 258: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/258.jpg)
Window Commands
:vertical
:windo
:wincmd
![Page 259: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/259.jpg)
Window Keys
More than you’ll ever need (or want)
Good candidates for your own key maps
:help windows.txt
:help ctrl-w
![Page 260: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/260.jpg)
Window Settings
splitbelow
splitright
winminheight
winminwidth
winheight
![Page 261: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/261.jpg)
Creating Tab Pages
:tabnew
:tabedit
<C-W> T
![Page 262: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/262.jpg)
Moving Between Tab Pages
gt
gT
Ngt
Often mapped to OS-specific keystrokes
![Page 263: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/263.jpg)
Moving Tab Pages
:tabmove
:tabmove N
...or just use the mouse (in the GUI)
![Page 264: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/264.jpg)
Closing Tab Pages
:q in last window
:tabclose
GUI often provides a close button
![Page 265: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/265.jpg)
Closing Other Tab Pages
:tabclose N
:tabonly
![Page 266: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/266.jpg)
Tab Page Settings
tabline
guitablabel
May be OS-specific options as well
![Page 267: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/267.jpg)
Tab Page Commands
:tab
:tabs
:tabdo
![Page 268: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/268.jpg)
What Good are Tab Pages?
Full-page help, docs, etc.
Alternate layouts
Temporary work
Diffs
Multiple projects
Mini-sessions
![Page 269: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/269.jpg)
Instances
A single instance includes all buffers, windows, tabs, settings, etc.
Easy to create more than one, especially in the terminal
...but that’s usually not necessary
...and usually isn’t a good idea
![Page 270: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/270.jpg)
![Page 271: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/271.jpg)
Syntax Highlighting
Highlights keywords, operators, blocks of text based on patterns in language-specific syntax files
Not a parser, but still very powerful
Can be nested
Useful for more than just programming languages
![Page 272: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/272.jpg)
Indentation
Automatically indent different types of files based on rules in language-specific indentation files
Like syntax highlighting, can be used for more than just programming languages
![Page 273: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/273.jpg)
Plugins
![Page 274: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/274.jpg)
NERD Tree
![Page 275: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/275.jpg)
![Page 276: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/276.jpg)
Command-TPeepOpenFuzzyFileFinder
![Page 277: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/277.jpg)
![Page 278: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/278.jpg)
![Page 279: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/279.jpg)
![Page 280: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/280.jpg)
![Page 281: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/281.jpg)
Bufexplorer
![Page 282: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/282.jpg)
![Page 283: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/283.jpg)
Taglist
![Page 284: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/284.jpg)
![Page 285: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/285.jpg)
![Page 286: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/286.jpg)
ResourcesVimhttp://www.vim.org/
MacVimhttp://code.google.com/p/macvim/
Vim Plugins, Add-Ons, Scriptshttp://www.vim.org/scripts/index.php
Vim Mailing Listshttp://www.vim.org/maillist.php
Vim Tips Wikihttp://vim.wikia.com/wiki/Vim_Tips_Wiki
![Page 287: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/287.jpg)
ResourcesEfficient Editing With Vimhttp://jmcpherson.org/editing.html
Zenclavier: Extreme Keyboardinghttp://www.oreilly.com/news/zenclavier_1299.html
Your problem with Vim is that you don’t grok vihttp://stackoverflow.com/questions/1218390/#1220118
Everyone Who Tried to Convince Me to use Vim was Wronghttp://yehudakatz.com/2010/07/29/everyone-who-tried-to-convince-me-to-use-vim-was-wrong/
Damian Conway’s “Scripting the Vim Editor” Serieshttps://www.ibm.com/developerworks/linux/library/l-vim-script-1/
![Page 288: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/288.jpg)
Resourcesgodlygeek's explanation of buffers, windows, and tabshttp://vim.pastey.net/115548
VimCasts - How to use buffers/windows/tabshttp://vimcasts.org/episodes/working-with-buffers/http://vimcasts.org/episodes/working-with-windows/http://vimcasts.org/episodes/working-with-tabs/http://vimcasts.org/episodes/how-to-use-tabs/
Derek Wyatt - Working with Many Fileshttp://vimeo.com/6306508
Vim Tips Wiki - Tabshttp://vim.wikia.com/wiki/Category:Tabs
![Page 289: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/289.jpg)
ResourcesVimcastshttp://vimcasts.org/
Lococast Screencastshttp://lococast.net/archives/category/screencast
Derek Wyatt’s Vim Tutorial Videoshttp://www.derekwyatt.org/vim/vim-tutorial-videos/
![Page 290: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/290.jpg)
ResourcesBill Odom's Vim Environmenthttps://github.com/wnodom/wnodom-vim-environment
Steven Pritchard's Vim Environmenthttps://github.com/silug/vim-environment
Damian Conway's Vim Environmenthttps://github.com/thoughtstream/Damian-Conway-s-Vim-Setup
Steve Losh's Vim Environmenthttps://github.com/sjl
Tim Pope's Vim Environmenthttps://github.com/tpope/tpope
![Page 291: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/291.jpg)
ResourcesVim Geekshttp://vimgeeks.org/
@vimgeekshttp://twitter.com/vimgeeks
Vim-Related Twitter Accountshttps://twitter.com/#!/VimGeeks/following
![Page 292: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/292.jpg)
![Page 293: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/293.jpg)
Thanks!
![Page 294: Vim From Essentials to Mastery 2011](https://reader030.vdocuments.us/reader030/viewer/2022012821/544caaadb1af9f59608b45ed/html5/thumbnails/294.jpg)