My vim setup
Back to some python coding recently, I’ve been very frustrated with setting up virtualenv in eclipse/pydev, and as the other IDEs don’t satisfy me neither, I decided to give vim a chance ! After some googling, I managed to setup a really cool programming environment !
You can find it here: http://vim.spf13.com I’ve used vim occasionally, mainly to edit config files on my server, but would have never imagined how powerful vim can be with the help of plugins. After installing SPF13, I had to tune ~/.vimrc to be able to use fully some plugins. I’m running vim on ubuntu 14.04, maybe the following won’t apply for other OS.
This line enables special characters support in airline plugin:
Somehow airline displayed a strange character after the git icon, in gvim only. In order to fix airline in gvim, I had to install patched fonts from https://github.com/powerline/fonts. Just clone the repository, then install your favorite police (in my case inconsalata) with kde system settings > font management. Then change the following line in ~/.vimrc:
if has('gui_running') set guioptions-=T " Remove the toolbar set lines=40 " 40 lines of text instead of 24 if !exists("g:spf13_no_big_font") if LINUX() && has("gui_running") "Replace this line with the following one: set guifont=Andale\ Mono\ Regular\ 12,Menlo\ Regular\ 11,Consolas\ Regular\ 12,Courier\ New\ Regular\ 14 set guifont=Inconsolata\ for\ Powerline\ Regular\ 12 elseif OSX() && has("gui_running") set guifont=Andale\ Mono\ Regular:h12,Menlo\ Regular:h11,Consolas\ Regular:h12,Courier\ New\ Regular:h14 elseif WINDOWS() && has("gui_running") set guifont=Andale_Mono:h10,Menlo:h10,Consolas:h10,Courier_New:h10 endif endif else
Then in vim just run
The default shortcut didn’t suited me, so I added a new one in ~/.vimrc.local:
nnoremap <Leader>l :Bufferlistsw <CR>
Here is how my ~/.vimrc.local looks like:
As you can see, I added angular support, and changed the default color scheme. The command
set mouse= is very useful as it allows you to paste in vim from your OS clipboard.