| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254 | " Vundleset nocompatible              " be iMproved, requiredfiletype off                  " required" set the runtime path to include Vundle and initializeset rtp+=~/.vim/bundle/Vundle.vimcall vundle#begin()" alternatively, pass a path where Vundle should install plugins"call vundle#begin('~/some/path/here')" let Vundle manage Vundle, requiredPlugin 'VundleVim/Vundle.vim'" The following are examples of different formats supported." Keep Plugin commands between vundle#begin/end.Plugin 'mbbill/undotree'Plugin 'scrooloose/syntastic'Plugin 'vim-scripts/mru.vim'Plugin 'tpope/vim-fugitive'Plugin 'benmills/vimux'Plugin 'vim-airline/vim-airline'Plugin 'Valloric/YouCompleteMe'Plugin 'rust-lang/rust.vim'Plugin 'ctrlpvim/ctrlp.vim'" All of your Plugins must be added before the following linecall vundle#end()            " requiredfiletype plugin indent on    " required" To ignore plugin indent changes, instead use:"filetype plugin on"" Brief help" :PluginList       - lists configured plugins" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate" :PluginSearch foo - searches for foo; append `!` to refresh local cache" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal"" see :h vundle for more details or wiki for FAQ" Put your non-Plugin stuff after this line" space is Leadermap <space> <leader>""" Visualsyntax enable " enable syntax processingset nocursorline " don't highlight current lineset nohlsearch " disable search highlightset showmatch " highlight matching bracketsset lazyredraw " redraw only when necessary (faster macros)""" Tabsset tabstop=4 " number of visual spaces per TABset softtabstop=4 " number of spaces in tab when editingset shiftwidth=4 " number of space when using > or <set expandtab " tabs are spaces""" Numberingset number " show line numbersset rnu " show relative line numbers" toggle relative line nums when focus is gained/lost:au FocusLost * :set norelativenumber:au FocusGained * :set relativenumber" map C-n to toggle line numsfunction! NumberToggle()    if(&relativenumber == 1)        set norelativenumber    else        set relativenumber    endifendfuncnnoremap <Leader>n :call NumberToggle()<CR>""" Command menu and Searchingset wildmenu " visual autocomplete for command menuset wildmode=longest,full " don't autocomplete on first tab pressset showcmd " show command in bottom barset incsearch " search as characters are entered" search through subdirectories when looking for filesset path+=**""" Foldsset foldmethod=indent " fold based on indentset foldlevelstart=20 " foldlevel when window is loadedset foldmethod=indent " fold based on indent level""" Insert mode" backspace is used to remove previous characters, indents, and newlinesset backspace=indent,eol,start" Map Ctrl-Backspace to delete the previous word in insert mode.imap <C-BS> <C-W>""" Filetypesautocmd FileType make setlocal noexpandtab " set Makefiles with tabs not spacesfiletype indent on " load filetype-specific indent files" ensure normal tabs and 8 space tabs in assembly filesautocmd FileType asm set noexpandtab shiftwidth=8 softtabstop=0""" System/OSset mouse= " disable the mouse" set shell to zsh on linux (if it exists)if !(has("win32") || has("win16") || has("win32unix"))    if filereadable("/bin/zsh") && $SHELL=="/bin/zsh"        silent! set shell=/bin/zsh    endifendifset updatecount=10 " swap files are rotated every 10 keystrokes" make an undo file to allow undoing after closing a fileset undofileset undodir=~/.vim/undodir" compare current buffer to saved filefunction! s:DiffWithSaved()  let filetype=&ft  diffthis  vnew | r # | normal! 1Gdd  diffthis  exe "setlocal bt=nofile bh=wipe nobl noswf ro ft=" . filetypeendfunctioncom! DiffSaved call s:DiffWithSaved()" map the comp buff function abovenoremap <Leader>d :DiffSaved<CR>" write w/ privileges when Vim isn't started as rootcmap w!! %!sudo tee > /dev/null %" ignore modelinesset modelines=0" toggle backgroundfunction! ClearBG()  highlight Normal ctermbg=noneendfunctionfunction! BlackBG()  highlight Normal ctermbg=blackendfunction""" Key shortcuts" remove trailing whitespace and return to start position" remove highlight if in nvimif has('nvim')    noremap <Leader>w :%s/\s\+$//<CR>:nohl<CR>``else    noremap <Leader>w :%s/\s\+$//<CR>``endif" <Leader>l formats a linenoremap <Leader>l Vgq" <Leader>s toggles spellingfunction! SpellToggle()    if(&spell == 1)        setlocal nospell    else        setlocal spell spelllang=en_us    endifendfuncnnoremap <Leader>s :call SpellToggle()<CR>""" Plugins" show recently opened filesnoremap <Leader>m :MRU<CR>" show undo treenoremap <Leader>u :UndotreeToggle<CR>" syntastic/YCMif exists(':SyntasticStatuslineFlag()')    set statusline+=%#warningmsg#    set statusline+=%{SyntasticStatuslineFlag()}    set statusline+=%*    let g:syntastic_always_populate_loc_list = 1    let g:syntastic_auto_loc_list = 1    let g:syntastic_check_on_open = 1    let g:syntastic_check_on_wq = 0endif" YouCompleteMelet g:ycm_global_ycm_extra_conf = '/home/josh/.vim/bundle/ycm_extra_conf.py'" autoclose suggestion windowslet g:ycm_autoclose_preview_window_after_insertion=1" colorshighlight YcmWarningSection ctermfg=Yellowhighlight YcmWarningSign ctermfg=Yellowhighlight YcmErrorSection ctermfg=Redhighlight YcmErrorsign ctermfg=Red"" diff colorshighlight DiffAdd    cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Redhighlight DiffDelete cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Redhighlight DiffChange cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Redhighlight DiffText   cterm=bold ctermfg=10 ctermbg=88 gui=none guifg=bg guibg=Red" place the vim-airline bar above the command lineset laststatus=2" ignore trailing whitespace in markdownautocmd FileType markdown AirlineToggleWhitespace""" Neovimif has('nvim')    " Esc returns to normal mode in terminal mode    tnoremap <C-w> <C-\><C-n><C-w>endif
 |