" General syntax on filetype on filetype plugin on set nocompatible set autoindent set smartindent set linespace=2 " Code Folding set foldlevelstart=20 set foldmethod=indent " Fix line numbers and tabs set number set tabstop=4 softtabstop=4 shiftwidth=4 expandtab " Set colors colorscheme railscasts set t_Co=256 set cursorline autocmd BufEnter * :syntax sync fromstart " Set the Command Line set showcmd set showmode set laststatus=2 " Move lines up/down nnoremap :m .+1== nnoremap :m .-2== vnoremap :m '>+1gv=gv vnoremap :m '<-2gv=gv " Automatically change current directory to that of the file in the buffer autocmd BufEnter * cd %:p:h " Disable gvim toolbars by default set guioptions-=T set guioptions-=m> " Use Ctrl+F2 to toggle gui map :if &guioptions =~# 'T' \set guioptions-=T \set guioptions-=m \else \set guioptions+=T \set guioptions+=m \endif " Remove trailing spaces on save autocmd BufWritePre * :%s/\s\+$//e " Use CTRL+S to save file changes command -nargs=0 -bar Update if &modified \| if empty(bufname('%')) \| browse confirm write \| else \| confirm write \| endif \|endif " Undo and swap dirs set undodir=~/.vim/undodir set dir=~/.vim/swapdir " Disable netrw let g:loaded_netrw = 1 let g:loaded_netrwPlugin = 1 " Easily switch between split windows nnoremap h nnoremap j nnoremap k nnoremap l " Easily move split windows nnoremap H nnoremap J nnoremap K nnoremap L " Opens a split and switches over (\v, \s) nnoremap v vl nnoremap s sj nnoremap :Update inoremap :Update imap < :tabprevious nnoremap :tabnext nnoremap :tabnew inoremap :tabpreviousi inoremap :tabnexti inoremap :tabnew " Bundles set rtp+=~/.vim/bundle/vundle/ call vundle#rc() Bundle 'gmarik/vundle' Bundle 'The-NERD-tree' Bundle 'majutsushi/tagbar' Bundle 'Lokaltog/vim-powerline' Bundle 'vim-ruby/vim-ruby' Bundle 'tpope/vim-sensible' Bundle 'tpope/vim-commentary' Bundle 'tpope/vim-repeat' Bundle 'tpope/vim-endwise' Bundle 'tpope/vim-surround' Bundle 'tpope/vim-fugitive' Bundle 'bronson/vim-trailing-whitespace' Bundle 'SingleCompile' Bundle 'jiangmiao/auto-pairs' Bundle 'pangloss/vim-javascript' Bundle 'kien/ctrlp.vim' Bundle 'jelera/vim-javascript-syntax' Bundle 'genutils' Bundle 'Nibble' " NERDTree map :NERDTreeToggle " Tagbar map :TagbarToggle " SimpleCompile nmap :SCCompile nmap :SCCompileRun