Vim

339 views

Published on

Vim tutorial

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
339
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Vim

  1. 1. Vim
  2. 2. ● Vim comes with most Linux distros and OS X ● vimrc - allows customization(config file) ● Pathogen - easily install vi plugins https://github.com/tpope/vim-pathogen drop .vim plugin files into ~/.vim/bundle ● map caps lock key to Esc Getting Started
  3. 3. ● config settings like: - ignorecase - shiftwidth - syntax highlighting - tab navigation - leader character mappings Let’s take a look at my vimrc .vimrc wizardry
  4. 4. ● ctrlp - https://github.com/kien/ctrlp.vim ● nerdcommenter - https://github.com/scrooloose/nerdcommenter ● ack - https://github.com/mileszs/ack.vim ● vim-coffee-script - https://github.com/kchmck/vim-coffee-script ● vim-jade - https://github.com/digitaltoad/vim-jade Really Neat Plugins
  5. 5. ● verbs: c (change), d (delete), y (yank/copy)...and more ● modifiers: i (inside), a (around), t (till..finds a character), f (find..like till except including the char) ● text objects: w (word), s (sentence), b (block/parentheses), symbols(e.g. “ or ()) Grammar
  6. 6. ● Command mode ● Insert mode ● Visual mode Let’s do some examples Vim Modes
  7. 7. ● provides quick shortcuts for tedious commands ● kind of like aliases from the command line Let’s create one Leader Character
  8. 8. ● lightweight and fast, no lag ● vi/vim is on most remote servers ● never need your mouse ● great for front-end apps ● keeps you sharp!(syntactically) ● It’s a blast! Sort of like playing a video game while you work Why use Vim?
  9. 9. ● allows you to record and execute a sequence of operations ● record macro(in command mode): - type q to start a recording - type any lowercase letter or #(to assign your recording to a register) - perform your operations - type q to stop recording ● execute macro: - <n>@<macro register> (e.g. 10@q) Macros

×