My VIM Setup for Live Coding

Posted on Posted in Ideas, Tutorials

In my recent post about my general setup for live coding, I mentioned that I use VIM with a handful of plugins. Here I’ll go into more detail about how I have VIM configured.

Plugins

I’ll start with what plugins I’m using because some of my configurations will include them. First off, you’ll need pathogen (if you’d rather use a different vim plugin manager go ahead, but this is what I use). Just follow the instructions in the readme and you’ll be up and running. After that, install all your plugins in ~/.vim/bundle/ and they’ll *just work*.

Here are all the plugins I currently use (feel free to use all, none, or more yourself). Some of these I use more than others but I’ll put them all here just for completeness.

There are a handful of things in there that are not specific to live coding or SuperCollider at all, but I thought I’d show everything that I have installed. For instance, you don’t need any of the tmux stuff unless you work with tmux (if you don’t know what tmux is, just ignore all of them).

.vimrc

Now for the meat: the actual vim configurations.

syntax on
set wildmode=longest,list,full
set wildmenu
” toggle paste mode with F8
set pastetoggle=
set ruler
set nu
set hidden
” enable pathogen
execute pathogen#infect()
filetype plugin indent on
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
let g:SuperTabDefaultCompletionType = “context”
set background=dark
colorscheme blazer
” local scvim configuration file
so ~/Sources/supercollider/editors/scvim/scvimrc

” switch to a lower split with C-J
nnoremap
” switch to an upper split with C-K
nnoremap
” switch to a right split with C-L
nnoremap
” switch to a left split with C-H
nnoremap
” default new vertical splits to be below the active split
set splitbelow
” default new horizontal splits to be right of the active split
set splitright

” C-n toggles nerdtree
map :NERDTreeToggle

” Better command-line completion
set wildmenu

” 265 color support
let &t_Co=256

” auto reload the .vimrc file when it’s saved
au! bufwritepost .vimrc source %
autocmd BufWinLeave *.* mkview
autocmd BufWinEnter *.* silent loadview
highlight Folded ctermbg=black ctermfg=green

” syntastic options
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0

” Reduce timeout after is recvd. This is only a good idea on fast links.
set ttimeout
set ttimeoutlen=20
set notimeout

let g:xptemplate_minimal_prefix = 0

let g:rainbow_active = 1

There are some comments in there, and other things should be pretty self explanatory. There are many great articles about good .vimrc settings hanging around on the internet so I could suggest googling around a bit about anything you don’t understand. They would probably explain things better than I would, and that’s how I found most of it myself (I’m not a VIM expert by any means yet).

Finding a color scheme I liked, finding and getting used to all the plugins, and further tweaking VIM, has been a long process. I’ve been working all this out for about a year now and it’s still constantly evolving. All of this is of course a matter of taste and should not be taken as “the way” to configure your VIM for live coding.