" We don't want to be in compliance mode with Vi set nocompatible filetype off call plug#begin('~/.vim/plugged') Plug 'bling/vim-airline' Plug 'kien/ctrlp.vim' Plug 'vim-scripts/matchit.zip' Plug 'jelera/vim-javascript-syntax', { 'for': 'javascript' } Plug 'scrooloose/syntastic' Plug 'scrooloose/nerdtree' Plug 'tpope/vim-commentary' Plug 'tpope/vim-repeat' Plug 'tpope/vim-surround' Plug 'tpope/vim-unimpaired' Plug 'tpope/vim-fugitive' Plug 'tpope/vim-markdown' Plug 'airblade/vim-gitgutter' Plug 'jlanzarotta/bufexplorer' Plug 'marijnh/tern_for_vim', { 'for': 'javascript' } Plug 'Raimondi/delimitMate' Plug 'xolox/vim-misc' Plug 'xolox/vim-easytags' Plug 'majutsushi/tagbar' Plug 'Shougo/neocomplete' Plug 'Shougo/neosnippet.vim' Plug 'Shougo/neosnippet-snippets' Plug 'editorconfig/editorconfig-vim' Plug 'sjl/gundo.vim' Plug 'Lokaltog/vim-easymotion' Plug 'kchmck/vim-coffee-script' Plug 'lukaszkorecki/CoffeeTags' Plug 'Yggdroot/indentLine' Plug 'groenewege/vim-less' Plug 'tpope/vim-haml' Plug 'godlygeek/tabular' Plug 'keith/investigate.vim' Plug 'jwhitley/vim-literate-coffeescript' call plug#end() filetype plugin indent on if !exists('g:neocomplcache_force_omni_patterns') let g:neocomplcache_force_omni_patterns = {} endif let g:neocomplcache_force_omni_patterns.java = '\k\.\k*' set tags=./tags set wildmode=list:longest " make TAB behave like in a shell set autoread " reload file when changes happen in other editors set mouse=a set bs=2 " make backspace behave like normal again let $VIMHOME = $HOME."/.vim" " make yank copy to the global system clipboard set clipboard=unnamedplus " Neocomplete Setup let g:neocomplete#enable_at_startup = 1 " Set encoding set encoding=utf-8 " Make history go insane, but safe my sanity set history=700 set undolevels=700 " Make search case insensitive set hlsearch set incsearch set ignorecase set smartcase " Disable stupid backup and swap files - they trigger too many events " for file system watchers set nobackup set nowritebackup set noswapfile " Bind nohl noremap h :nohl " Enable hidden buffers, so we can switch buffers without saving them. set hidden " Fix for ViM Airline Plugin set laststatus=2 " Make backspace behave like normal again set bs=2 " " Enable syntax highlighting syntax enable autocmd BufNewFile,BufReadPost *.coffee setl foldmethod=indent nofoldenable autocmd FileType litcoffee runtime ftplugin/coffee.vim " Airline Plugin Configuration let g:airline_powerline_fonts=1 " CTRLP Plugin Configuration " do not change working directory each time I invoke ctrlp let g:ctrlp_working_path_mode = 0 set runtimepath^=~/.vim/bundle/ctrlp.vim let g:ctrlp_max_height = 30 let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git\|tmp\|dist' set wildignore+=*tmp/*,*.so,*.swp,*.zip " indentLine Plugin Configuration let g:indentLine_fileTypeExclude = ['json'] " NeoComplete Plugin Configuration imap (neosnippet_expand_or_jump) smap (neosnippet_expand_or_jump) xmap (neosnippet_expand_target) " Syntastic Plugin Configuration let g:syntastic_javascript_checkers = ['jshint'] let g:syntastic_php_checkers = ['php', 'phpcs', 'phpmd'] let g:syntastic_java_javac_classpath = "src/:lib/" " TagBar Plugin Configuration let g:tagbar_foldlevel = 0 "close tagbar folds by default let g:tagbar_sort = 0 "tagbar shows tags in order of they created in file let g:tagbar_autofocus = 1 " Tern Plugin Configuration " disable preview window for tern_for_vim set completeopt-=preview " UltiSnips Plugin Configuration let g:UltiSnipsSnippetsDir = "~/.vim/my_snippets" let g:UltiSnipsSnippetDirectories=["UltiSnips"] " let g:UltiSnipsListSnippets = "" " let g:UltiSnipsExpandTrigger="" " let g:UltiSnipsJumpForwardTrigger="" " let g:UltiSnipsJumpBackwardTrigger="" " vim-markdown Plugin Configuration let g:vim_markdown_folding_disabled=1 " Real programmers use spaces instead of tabs. set tabstop=2 set shiftwidth=2 set softtabstop=2 set expandtab " Showing line numbers and length set number set tw=79 " width of document set nowrap " don't automatically wrap on load set fo-=t " don't automatically wrap text when typing " Show bar for length if exists('+colorcolumn') set colorcolumn=80 highlight ColorColumn ctermbg=233 endif " Show whitespace set listchars=tab:>-,nbsp:%,extends:>,precedes:<,trail:- set list set t_Co=256 set background=dark colorscheme wombat256i let g:airline_theme='wombat' " Rebind key let mapleader = "," " Allow saving of files as sudo when I forgot to start vim using sudo. command W :execute ':silent w !sudo tee % > /dev/null' | :edit! " Switch Tab vs Spaces let g:WalialuUtils_IndentationSwitch = 0 function! WalialuUtils_IndentationSwitch() if g:WalialuUtils_IndentationSwitch == 1 set expandtab let g:WalialuUtils_IndentationSwitch = 0 let g:syntastic_php_phpcs_args = "--tab-width=" else set noexpandtab let g:WalialuUtils_IndentationSwitch = 1 let g:syntastic_php_phpcs_args = "--standard=CakePHP --tab-width=" endif echo "Indent with Tabs? " . g:WalialuUtils_IndentationSwitch endfunc nnoremap :call WalialuUtils_IndentationSwitch() function! g:WalialuUtils_encodeUmlauts() " Encodes ü ö ä Ä Ü Ö ß :'<,'>s/\Cü/\ü/g :'<,'>s/\Cö/\ö/g :'<,'>s/\Cä/\ä/g :'<,'>s/\CÄ/\Ä/g :'<,'>s/\CÜ/\Ü/g :'<,'>s/\CÖ/\Ö/g :'<,'>s/ß/\ß/g endfunc set relativenumber nnoremap l :call NumberToggle() " Toggle Vim Hardmode nnoremap h :call ToggleHardMode() " PHP Crap nnoremap :! phpcs --standard=CakePHP %:p " Dont mess with paste stuff nnoremap :set paste! " Gundo toggle nnoremap :GundoToggle " Quicksave command noremap w :update vnoremap w :update inoremap w :update " Clear the search buffer when hitting return :nnoremap bd :bd " Indentation vnoremap < >gv " NERD Tree Binding nnoremap t :NERDTreeToggle " BufExlorer nnoremap be :BufExplorer " Switch buffers nnoremap :b# " Switch buffers nnoremap nn :nohl " investigate.vim binding nnoremap q :call investigate#Investigate() " Toggle Tagbar plugin let g:tagbar_autofocus=1 nnoremap j :TagbarToggle " vim:tabstop=2:expandtab