Skip to main content

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 the find 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โ€‹

Referencesโ€‹