Wednesday, December 11, 2013

My vim configuration file

I have to say that Vim is the best editor for Linux embedded programmer because it is almost available on every system. When I learned to configure Vim, there are tons of plugins and tutorials. It really took me some time to finally find suitable configuration for me.

First of all, most important plugin is a package management plugin.

" Let NeoBundle manage NeoBundle
NeoBundleFetch 'Shougo/neobundle.vim'

The usage of NeoBundle is shown as following.

1. Download neobundle

$ mkdir -p ~/.vim/bundle 
 $ git clone git://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim

2. Example of configure neobundle in vimrc
Sample .vimrc:
 if has('vim_starting')
   set nocompatible               " Be iMproved
   set runtimepath+=~/.vim/bundle/neobundle.vim/
 endif

 call neobundle#rc(expand('~/.vim/bundle/'))

 " Let NeoBundle manage NeoBundle
 NeoBundleFetch 'Shougo/neobundle.vim'

 " Recommended to install
 " After install, turn shell ~/.vim/bundle/vimproc, (n,g)make -f your_machines_makefile
 NeoBundle 'Shougo/vimproc'

 " My Bundles here:
 "
 " Note: You don't set neobundle setting in .gvimrc!
 " Original repos on github
 NeoBundle 'tpope/vim-fugitive'
 NeoBundle 'Lokaltog/vim-easymotion', '09c0cea8'   " This plugin is locked at revision 09c0cea8 
 NeoBundle 'rstacruz/sparkup', {'rtp': 'vim/'}
 " vim-scripts repos
 NeoBundle 'L9'
 NeoBundle 'FuzzyFinder'
 NeoBundle 'rails.vim'
 " Non github repos
 NeoBundle 'git://git.wincent.com/command-t.git'
 " gist repos
 NeoBundle 'gist:Shougo/656148', {
       \ 'name': 'everything.vim',
       \ 'script_type': 'plugin'}
 " Non git repos
 NeoBundle 'http://svn.macports.org/repository/macports/contrib/mpvim/'
 NeoBundle 'https://bitbucket.org/ns9tks/vim-fuzzyfinder'

 " ...

 filetype plugin indent on     " Required!
 "
 " Brief help
 " :NeoBundleList          - list configured bundles
 " :NeoBundleInstall(!)    - install(update) bundles
 " :NeoBundleClean(!)      - confirm(or auto-approve) removal of unused bundles

 " Installation check.
 NeoBundleCheck

Any fancy status bar can't work for me, I'm just using a simple status bar.

Some other key mappings are just for myself.






No comments: