Monday, 21 November 2011

Rails: Basic vim config

Vim supports a whole lot of features, however I've listed the basic config to get started with development in rails.

set nocompatible          " We're running Vim, not Vi!
syntax on                 " Enable syntax highlighting
filetype plugin indent on " Enable filetype-specific indenting and plugins

" Load matchit (% to bounce from do to end, etc.)
runtime! macros/matchit.vim

augroup myfiletypes
  " Clear old autocmds in group
  " autoindent with two spaces, always expand tabs
  autocmd FileType ruby,eruby,yaml set ai sw=2 sts=2 et
augroup END

nmap <leader>rci :%!ruby-code-indenter<cr>
Apart from this, you can also tweek any config under /etc/vim/vimrc , based on your preference.

No comments:

Post a Comment