" init.vim " If you have any questions about my settings, remember to use :help runtime! archlinux.vim call plug#begin('~/.config/vim/plugged') " Go stuff Plug 'fatih/vim-go' " Perl Stuff " Currently neovim doesn't support this plugin " Plug 'vim-scripts/perl-support.vim' Plug 'c0s/perlomni.vim' Plug 'vim-airline/vim-airline' "Statusline Plug 'vim-airline/vim-airline-themes' "Statusline Plug 'majutsushi/tagbar' Plug 'easymotion/vim-easymotion' " motions Plug 'garbas/vim-snipmate' " Automagically completes code blocks Plug 'honza/vim-snippets' " Required by snipmate Plug 'justinmk/vim-syntax-extra' " More syntax highlighting Plug 'jvirtanen/vim-octave' "Extra octave highlighting Plug 'Lokaltog/powerline-fonts' " Required by airline Plug 'lilydjwg/colorizer' " Color rgb text Plug 'MarcWeber/vim-addon-mw-utils' " Required by snipmate Plug 'scrooloose/nerdtree' Plug 'tomtom/tlib_vim' " Required by snipmate Plug 'tpope/vim-endwise' "Automagically closes more stuff Plug 'tpope/vim-fugitive' "Git features Plug 'vim-ruby/vim-ruby' Plug 'vim-scripts/mru.vim' "ru for recently used files Plug 'Xuyuanp/nerdtree-git-plugin' Plug 'kien/rainbow_parentheses.vim' call plug#end() " Abbreviations " " " au FileType java,c,cpp abbrev if if() {}kkw au FileType java,c,cpp,perl abbrev while while() {}kkw au FileType java,c,cpp abbrev for for() {}kkwa au FileType java,c,cpp abbrev /* /* * */kA au FileType vim abbrev =header= "" " "kA " Autocommands " " " au FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o au BufNewFile * call LoadTemplate() au FileType sh,bash,perl,python,ruby nno ex :! chmod +x % " Colors " " " syntax on " TODO: Figure out how to change this based on the system theme colorscheme haruko " Functions " " " function! LoadTemplate() silent! 0r ~/.config/vim/skel/tmpl.%:e " Highlight %VAR% placeholders with the Todo color group syn match Todo "%\u\+%" containedIn=ALL endfunction " Syntax Analysis function! SynStack() if !exists("*synstack") return endif echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")') endfunc " Mappings " " " let mapleader = "\" nno @ nno bdw " Return to visual selection when indenting vno < >gv " Run files from vim au FileType perl nno :! perl % au FileType perl nno ' :! perl % " Precision editing nno c :set cul! cuc! rnu! spell! nno ;j :bn nno ;k :bp nno ;q :bdelete nno ;h :tabp nno ;l :tabn nno 1 1gt nno 2 2gt nno 3 3gt nno 4 4gt nno 5 5gt " Moving characters nno L xp nno H xP no j no k no h no l no j j no k k no h h no l l nno w :w nno so :so % nno ra :%s/ nno tn :tabnew nno Tn :tabnew nno sw :set list! no vn :vsplit no Vn :vsplit no hn :split no Hn :split "set pastetoggle=p " paste mode " Treat long lines as break lines (useful when moving around in them) no j gj no k gk nno ru :MRU no ff :NERDTreeToggle nno :call SynStack() nno ino vno cno " Settings " " " " filetype plugin indent on set autoindent set autoread set cc=80 set cmdheight=1 set equalalways set encoding=utf8 set ffs=unix,dos,mac set foldenable set foldmethod=marker set foldcolumn=1 set hidden set hlsearch set ignorecase set lazyredraw set list listchars=tab:»·,trail:· set ls=2 set magic set modeline set modelines=5 set nobackup set noerrorbells set noshowmode set nolist set notitle set novisualbell set nu set noruler set shiftwidth=3 set showmatch set smartindent set sps=best,10 set tabstop=3 " Airline " " " let g:airline_theme='ubaryd' let g:airline#extensions#tabline#enabled = 0 let g:airline_powerline_fonts = 1 let g:Powerline_symbols = 'fancy' let g:airline_detect_modified=1 let g:airline_detect_paste=1 " powerline symbols "let g:airline_left_alt_sep = '' "let g:airline_right_alt_sep = '' let g:airline_left_alt_sep = '' let g:airline_right_alt_sep = '' function! MyOverride(...) call a:1.add_section('StatusLine', ' ' . g:airline_section_a . ' ') call a:1.add_section('StatusLine2', ' ' . g:airline_section_b . ' ') call a:1.add_section('StatusLine3', ' %f') call a:1.split() call a:1.add_section('StatusLine2', ' ' . g:airline_section_x . ' ') call a:1.add_section('ErrorLine', ' ' . g:airline_section_error . ' ' . g:airline_section_warning . ' ') call a:1.add_section('StatusLine', ' %p%% ') return 1 "tells the pipeline to write the statusline with the builder endfunction call airline#add_statusline_func('MyOverride') " Eclim " " " let g:EclimCompletionMethod = 'omnifunc' " MRU " " " let MRU_File = '/home/ryan/.config/vim/.vim_mru_files' let MRU_Exclude_Files = '^/tmp/.*\|^/var/tmp/.*' let MRU_Window_Height = 15 " Nerdtree " " " " Closes vim if nerdtree is the only open window " Causes error on regular nerdtree close "autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif " Changing the arrows let g:NERDTreeDirArrows = 1 let g:NERDTreeDirArrowExpandable = '0' let g:NERDTreeDirArrowCollapsible = '1' " Close nerdtree on file open let g:NERDTreeQuitOnOpen = 1 let g:NERDTreeMouseMode = 2 " Rainbow Parentheses " " " au VimEnter * RainbowParenthesesToggle au Syntax * RainbowParenthesesLoadRound au Syntax * RainbowParenthesesLoadSquare au Syntax * RainbowParenthesesLoadBraces " You Complete Me " " " let g:ycm_path_to_python_interpreter = '/usr/bin/python2' let g:ycm_global_ycm_extra_conf = '/home/ryan/.config/vim/.ycm_extra_conf.py' " Debug let g:ycm_server_keep_logfiles = 1 let g:ycm_server_log_level = 'debug' let g:ycm_warning_symbol = '>' let g:ycm_error_symbol = '>>' let g:ycm_server_use_vim_stdout = 1