syn on set nonu set background=dark set nobackup set nowritebackup set noswapfile set noautoindent set nosmartindent set tabstop=2 set shiftwidth=2 set expandtab set mouse-=a set autoread set nocompatible set laststatus=2 set title set titleold="terminal" set titlestring=vim:\ %F " Command mode completion " See https://stackoverflow.com/questions/526858/how-do-i-make-vim-do-normal-bash-like-tab-completion-for-file-names "set wildmode=longest,list set wildmode=longest,list,full set wildmenu " Thanks to http://stackoverflow.com/questions/1673649/vimrc-action-onclose function! ResetTitle(title) " disable vim's ability to set the title exec "set title t_ts='' t_fs=''" " and restore it "exec ":!echo -e '\033kbash\033\\'\" exec ":!xtitle " a:title endfunction au VimLeave *mutt/* silent call ResetTitle("mutt") au VimLeave *remind/* silent call ResetTitle("wyrd") " Folding set foldmethod=syntax set foldlevelstart=1 let g:sh_fold_enabled = 1 let javaScript_fold=1 let perl_fold=1 let php_folding=1 let r_syntax_folding=1 let ruby_fold=1 let sh_fold_enabled=1 let vimsyn_folding='af' let xml_syntax_folding=1 " PHP let php_sql_query = 1 " Syntax highlight au BufNewFile,BufRead *.thtml set ft=php au BufNewFile,BufRead *.mdwn set ft=ikiwiki au BufNewFile,BufRead *.md set ft=ikiwiki au BufNewFile,BufRead *.rem set ft=remind au BufNewFile,BufRead Vagrantfile set ft=ruby augroup mkd autocmd BufRead *.mkd set ai formatoptions=tcroqn2 comments=n:> augroup END if has("autocmd") " Drupal *.module and *.install files. augroup module autocmd BufRead,BufNewFile *.profile set filetype=php autocmd BufRead,BufNewFile *.module set filetype=php autocmd BufRead,BufNewFile *.install set filetype=php autocmd BufRead,BufNewFile *.test set filetype=php augroup END endif " Pathogen - https://github.com/tpope/vim-pathogen call pathogen#infect() syntax on filetype plugin indent on " No modelines " https://lwn.net/Articles/20249/ " http://usevim.com/2012/03/28/modelines/ " http://www.techrepublic.com/blog/it-security/turn-off-modeline-support-in-vim/ set nomodeline set modelines=0 " Syntax check let g:syntastic_mode_map = { 'mode': 'passive', \ 'active_filetypes': [], \ 'passive_filetypes': [] } " Shortcut to open a new tab nmap n :tabnew " Quit and close shortcuts map q :wqa map f :wq map t :tabclose map m :q! " NERDTree section " Thanks to http://stackoverflow.com/questions/1447334/how-do-you-add-nerdtree-to-your-vimrc " Open NERDTree when vim starts "autocmd VimEnter * NERDTree "autocmd VimEnter * wincmd p autocmd FileType nerdtree set relativenumber autocmd FileType taglist set relativenumber function TabNew(address) execute ":tabnew" execute ":NERDTree " a:address endfunction function TabNewBookmark(bookmark) execute ":tabnew" execute ":NERDTreeFromBookmark " a:bookmark endfunction function OpenNERDTree() execute ":NERDTree" endfunction " Shortcuts cnoreabbrev t NERDTree cnoreabbrev b NERDTreeFromBookmark command -nargs=1 -complete=dir T :call TabNew() command -nargs=1 -complete=customlist,nerdtree#completeBookmarks B :call TabNewBookmark() command -nargs=0 OpenNERDTree :call OpenNERDTree() nmap t :OpenNERDTree " See http://superuser.com/questions/10588/how-to-make-cut-copy-paste-in-gvim-on-ubuntu-work-with-ctrlx-ctrlc-ctrlv "imap + "vmap c"+p vmap "+yi vmap "+c " Workaround for mail editing. There must be a plugin enabling autoindent in " mail composition, which is annoying. au FileType mail set noautoindent " For email: unfold and delete to your signature " See https://hroy.eu/tips/vim/email-delete-til-signature/ noremap ,dd zi:.;/^-- $/dO-- zi " Color scheme "colorscheme github "colorscheme solarized "colorscheme gentooish "colorscheme revolutions "colorscheme two2tango "colorscheme vj "colorscheme wood "colorscheme zenburn "colorscheme inkpot colorscheme xoria256