Favorite Vim Configurations

What are some of your favorite Vim configurations, plugins, and leader commands, that you can’t live with out?

I added this to my .vimrc this week:

" Warn when text exceeds 80 columns :au BufWinEnter * let w:m1=matchadd('Search', '\%<81v.\%>77v', -1) :au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1)

We are trying to stick to style guide so this was a no-brainer. Taken from here.

You can do this with built-in Vim options:

" Make it obvious where 80 characters is
set textwidth=80
set colorcolumn=+1
1 Like

nice. much butter, imo.

Vim is very powerful with just:

set nocompatible
syntax on
filetype plugin indent on

I think it’s worth spending some time in Vim with minimal settings so that you learn how to use Vi keys and commands.

For plugins, I regularly use:

  • ctrlp for finding files
  • relativenumber for fast line-based operations
  • dispatch.vim for running outside processes

I don’t use much else.

You can see common thoughtbot configuration in our dotfiles: https://github.com/thoughtbot/dotfiles/blob/master/vimrc

You can also see the list of plugins most of us use: https://github.com/thoughtbot/dotfiles/blob/master/vimrc.bundles

We had some discussion of Vim on the Weekly Iteration: Vim: To Config or Not to Config?

2 Likes

Thanks @jferris. This is pretty informative. So do you use the standard thoughtbot dot files? or do you stick with custom settings?

I use the thoughtbot dotfiles, although I don’t actually use a lot of what’s in there. It ends up being useful when people pair with me on my machine, though.

I have some extensions to the dotfiles. Most of my personal configuration is due to the fact that I use Arch Linux instead of OS X, like most thoughtbot developers.