2. Who Am I?
• Software Engineer at Windsor Circle
• Vim user since 2013
• Wrote a series of blogs on Vim in 2014
3. So What Is Vim?
• Open Source Text editor created in 1991, based
on an earlier text editor (vi) created in 1976 for
UNIX
• Terminal based, but can be used in UI
• Some variation on it or vi is shipped in ~all *nix
operating systems
• Charityware
17. Vim has different ideas about:
• Shortcut keys
• Copy and paste
• File system integration / management
• Configuration
• Keyboard vs mouse use
• Naming conventions
18. Why use Vim at all?
• Ubiquitous
• Many other editors don't run in a terminal
20. What is a modal editor?
• Commands are contextual
• Depending on what mode you’re in different
keystrokes do different things
21. What is a modal editor?
In this mode, typing `dd`
deletes the current line
In this mode, typing `dd`
writes out 2 ds
at the start of the line
22. Vim Modes
• Normal Mode
• Insert Mode
• Visual Mode
• Others (less important)
23. Normal mode
• “Normal”
• default when Vim is opened
• Keystrokes are commands
• From other modes use `esc` to switch to normal
mode
24. Insert Mode
• More normal for modern users
• Keystrokes insert text
• commands are possible with key combinations
• From normal mode use `i` to switch to insert
mode
25. Visual Mode
• For Highlighting/text selection
• keystrokes are commands
• From normal mode use `v` to switch to visual
mode
26. Ex Commands / Command
Prompt
• From normal mode `:` to
trigger ex commands
• File menu equivalent
• Used for opening, closing files
and the editor, find and
replace, command line
integration, more
32. Navigating Files
• Encourages use of hjkl instead of the arrow keys
• Arrow keys still work
• Mouse might or might not work depending on
your environment
35. Vim Survival
• Remember that Vim is modal
• Insert mode is “normal editing” mode
• Normal mode is “command mode”
• :w to save, :q to quit, :q! to quit decisively :)
38. Why use Vim over
[Sublime/Atom/VS/IntelliJ/XCode/etc]
?
• A beautiful editing language
• Command Line living
• Top notch flexibility and configurability
41. Vim as language
• dh -> delete one character to the left
• dl -> delete one character to the right
• dw -> delete to the start of the next word
• db -> delete back to the start of the current word
44. Vim as language
• dG - delete everything to the end of the file
• gUf. - all-caps to the next `.`
• cw - delete to the start of the next word, and then
enter insert mode to replace the text
45. Vim as language
• Text objects: iw, i(
• Double verbs apply to the whole line
46. Vim as language
• di( - delete everything inside the current parens
• gUiw - all-caps the current word
• dd - delete the current line
• cc -delete the current line and move to insert
mode
48. Vim as language
• verb + motion/text object -> action
• Each new command you learn works with
existing concepts
• Everyone has their own “accent”
49. Vim as Language: Repetition
• dot command `.` repeats the previous action
(combo of verb and motion/text object)
• You can use plain motions in between
50. Vim as Language: Repetition
• dw to delete to the start of the next word
• `..` to repeat 2 more times
52. Vim as a modern editor
• Fixing bad defaults comes through configuration
in ~/.vimrc file
• Control look and feel, custom commands
• https://dotfiles.github.io/
54. Vim as a modern editor
• Feature parity with other editors comes through
plugins
• http://vimawesome.com/
• Many plugin managers with Github compatibility
(pathogen, vundle, vim-plug)
• Plugins are ~100% open source, you can make your
own!
58. Vim as a modern editor
• Fuzzy-finder
• Linting
• Git Integration
• AutoComplete
• Status bars
• Command line integration
59. Resources
• Practical Vim by Drew Neil
• vimcasts.org
• http://benmccormick.org/learning-vim-in-2014/
60. Vim Language Elsewhere
• Neovim: a rethinking of Vim
• Vim modes: Sublime, Atom, IntelliJ, Visual Studio
• Command Line: vim modes for bash, zsh, fish
• Elsewhere: Gmail has vi-inspired shortcuts
Hi everybody. Isn’t this exciting? I’m thankful to get to have a cool event like this in the Triangle.
My name is Ben, and I’m going to be talking about Vim today.
This talk is a bit different than some of the other talks here
practical not theory
I’m talking about a 25 year old piece of software, not something new and shiny
To start, lets take a quick poll:
How many of you have heard of Vim?
How many of you have used Vim?
How many of you use Vim regularly?
Cool. Something for each of you etc
yes I’m the type of geek who decides to write long blog posts about a text editor
Text editor - general purpose, writing code, editing text files, writing prose
Donate to help children in Uganda (about a million dollars)
Vi - created by Bill Joy
Vim - Bram Moolenaar
Text editor - general purpose, writing code, editing text files, writing prose
Vi - created by Bill Joy
Vim - Bram Moolenaar
Title of the talk is Vim Survival Guide
Why ever NEED to use Vim
Why you’d ever WANT to use Vim
One thing we need to talk about first
Learning curve starts hard and stays hard
Even the people who use it can find it very frustrating
Simple things aren’t simple
True story, I actually got an email a few weeks ago from somebody who decided to write this book for real and put it on Amazon. He wanted me to review the book.
Complicated and Scary!! / lots of arbitrary memorization
Take the Jedi skeptic POV: It was great in the old days
Vim users are annoying and not as productive as they think
The thing is… a lot of people use and care about Vim
Initial learning curve
Initial learning curve
Emacs - lightweight, fast text editors, with pluggable functionality, that you control with complex key combinations
Shortcut keys - modal editors
Copy and paste - multiple clipboards, doesn’t integrate smoothly with modern OSes by default
Very text based rather than UI based in terms of file system integration, splits and buffer list rather than tabs (yes tabs are a thing but they’re weird)
Way more stuff is configurable than other editors, way more stuff requires configuration than other editors
This is a keyboard driven show
Buffer rather than file, delete/yank/put rather than cut/copy/paste, edit/write/ rather than open/save
Ubiquitous - make sure to point out that servers still matter for the windows folks in the audience
Visual editor (you can see the text of the file and change it)
Command prompt editor (you can enter commands)
select, command line ex-mode
Examples:
x in normal mode, delete current character
j in normal mode , go down
ctrl + w will delete the word before the cursor
:e /edit
:e /edit
:e /edit
Controversial statement: This is a dumb way to use Vim if you don’t care about using Vim