diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..28c45f4 --- /dev/null +++ b/.vimrc @@ -0,0 +1,105 @@ +syntax on +filetype off +set nocompatible + +" Fix line numbers and tabs +set number +set tabstop=4 softtabstop=4 shiftwidth=4 expandtab + +" Set colorscheme +colorscheme jellybeans +set t_Co=256 +set cursorline +filetype plugin on + +" Set the Command Line +set showcmd +set showmode +set laststatus=2 + +set guioptions-=T +set guioptions-=m> + +" Remove trailing spaces on save +autocmd BufWritePre * :%s/\s\+$//e +set autoindent + +set rtp+=~/.vim/bundle/vundle/ +call vundle#rc() + +" 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 + +" Use Ctrl+F2 to remove gui +map :if &guioptions =~# 'T' + \set guioptions-=T + \set guioptions-=m + \else + \set guioptions+=T + \set guioptions+=m + \endif + +" Undo dir +set undodir=~/.vim/undodir +set dir=~/.vim/swapdir + +" Disable netrw +let g:loaded_netrw = 1 +let g:loaded_netrwPlugin = 1 + +nnoremap :Update +inoremap :Update +imap < :tabprevious +nnoremap :tabnext +nnoremap :tabnew +nnoremap :tabclose +inoremap :tabpreviousi +inoremap :tabnexti +inoremap :tabnew +inoremap :tabclose + +" Maximize the GVim window +if has("gui_running") + " GUI is running or is about to start. + " Maximize gvim window. + set lines=999 columns=999 +else + " This is console Vim. + if exists("+lines") + set lines=50 + endif + if exists("+columns") + set columns=100 + endif +endif + +" Bundles + +Bundle 'gmarik/vundle' +Bundle 'The-NERD-tree' +Bundle 'Lokaltog/vim-powerline' +Bundle 'tpope/vim-commentary' +Bundle 'tpope/vim-repeat' +Bundle 'tpope/vim-endwise' +Bundle 'tpope/vim-surround' +Bundle 'bronson/vim-trailing-whitespace' +Bundle 'wincent/Command-T' +Bundle 'SingleCompile' +Bundle 'jiangmiao/auto-pairs' + +" NERDTree +map :NERDTreeToggle + +" SimpleCompile +nmap :SCCompile +nmap :SCCompileRun