Vim
Patterns and Anti-Patternsโ
- Pressing motion keys multiple times should be avoided (i.e.
jjjjj
). Instead, opt for[count]{motion}
(i.e.5j
) - Not mapping frequent operations to a shorter command with
map
." Tabs
map <Leader>tn :tabnext<CR>
map <Leader>tp :tabprev<CR>
map <Leader>tc :tabnew<CR>
map <Leader>tf :tabfirst<CR>
map <Leader>tl :tablast<CR>
Useful Pluginsโ
Vundleโ
My preferred Vim plugin manager
Command-Tโ
I swapped out ctrlp.vim for Command-T.
Note that when also using RVM, you need to run the extconf.rb
file by
referencing the correct version of Ruby, which means using
/usr/local/opt/ruby/bin/ruby extconf.rb
to call the right version.
Recommended changes:
- Set
let g:CommandTFileScanner = "git"
. This will fallback to thefind
option, but critically takes advantage of.gitignore
. - I mapped
<Leader>p
to<Plug>(CommandT)
because Iโm used to ctrlp.vim:nmap <silent> <Leader>p <Plug>(CommandT)
Learning Toolsโ
Fun Stuffโ
- tenderlove/initial-v, a BMW shifter which controls which Vim mode youโre in by triggering keyboard inputs
- alevchuk/vim-clutch, a hardware pedal that will move you in and out of insert mode when you press and release the pedal
Referencesโ
- My Dotfiles, GitHub
- Ben Orenstein โ Write code faster: expert-level vim (Railsberry 2012), YouTube
- Vim Help (although you should just use
:h
) - Your problem with Vim is that you donโt grok vi, StackOverflow
- MacVim is Vim with more OS integration
- A Vim Guide for Advanced Users
- Vim Tips for the Intermediate Vim User, by Jemma Issroff
- Moving Blazingly Fast With The Core Vim Motions, by Jaime Gonzรกlez Garcรญa