" set the runtime path to include Vundle and initialize "call has('python3') " Start plugins call plug#begin('~/.vim/plugged') " Javascript Plug 'heavenshell/vim-jsdoc', {'for': 'javascript'} "Plug 'moll/vim-node', {'for': 'javascript'} Plug 'sheerun/vim-polyglot' " C/C++ "Plug 'majutsushi/tagbar' Plug 'vim-scripts/DoxygenToolkit.vim', {'for': 'cpp'} " Syntax checking "Plug 'Valloric/YouCompleteMe' Plug 'w0rp/ale', "Plug 'scrooloose/syntastic' " Useful plugins Plug 'Raimondi/delimitMate' Plug 'scrooloose/nerdcommenter' Plug 'scrooloose/nerdtree' Plug 'jlanzarotta/bufexplorer' Plug 'ctrlpvim/ctrlp.vim' Plug 'ervandew/supertab' Plug 'reedes/vim-lexical' " Snippets Plug 'sirver/ultisnips' Plug 'honza/vim-snippets' " Themes "Plug 'Lokaltog/vim-distinguished' "Plug 'altercation/vim-colors-solarized' "Plug 'tomasr/molokai' "Plug 'flazz/vim-colorschemes' "Plug 'morhetz/gruvbox' Plug 'chriskempson/base16-vim' " Airline Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' let g:airline_theme='base16_default' let g:airline_powerline_fonts = 1 " Initialize plugin system call plug#end() filetype plugin indent on " Other set t_Co=256 set background=dark syntax on let base16colorspace=256 colorscheme base16-default-dark "colorscheme solarized "colorscheme gruvbox "colorscheme molokai "let g:molokai_original = 1 "let g:rehash256 = 1 "colorscheme distinguished "colorscheme ir_black "colorscheme summerfruit256 set autoindent " Automatically indent syntax on set cindent " Indentation for c set number " Add line numbers set hlsearch " Highlight search set sessionoptions=blank,buffers,curdir,folds,globals,help,localoptions,options,resize,tabpages,winsize,winpos "set autochdir " Change directory automatically "set backupdir=~/.vim/temp/ " Save temporary backups to temp dir "set directory=~/.vim/temp/ " Save temporary files to temp dir set hidden " Allow changing buffers eventhough they're not saved "set autowrite " Automatically save the buffer when changing to another buffers "set autowriteall " Automatically save ALL buffers when changing to another buffers set wildchar= wildmenu wildmode=full " Show possible commands by pressing TAB set wildcharm= " This will allow you to access bufferlist with wildcard by pressing F10 nnoremap :b " Indentation map mzgg=G`z map %s " NerdTree map :NERDTreeToggle imap :NERDTreeTogglei " NerdCommenter map ci au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery "augroup vimrc " au BufReadPre * setlocal foldmethod=indent " au BufWinEnter * if &fdm == 'indent' | setlocal foldmethod=manual | endif "augroup END inoremap za nnoremap za onoremap za vnoremap zf set nocp filetype plugin on filetype plugin indent on " configure tags - add additional tags here or comment out not-used ones "set tags+=~/.vim/tags/cpp "set tags+=~/.vim/tags/gl "set tags+=~/.vim/tags/sdl "set tags+=~/.vim/tags/boost "set tags+=~/.vim/tags/opencv2 " build tags of your own project with Ctrl-F12 "map :!ctags -R --sort=yes --c++-kinds=+p --fields=+iaS --extra=+q ../src/ " OmniCppComplete "let OmniCpp_NamespaceSearch = 1 "let OmniCpp_GlobalScopeSearch = 1 "let OmniCpp_ShowAccess = 1 "let OmniCpp_ShowPrototypeInAbbr = 1 " show function parameters "let OmniCpp_MayCompleteDot = 1 " autocomplete after . "let OmniCpp_MayCompleteArrow = 1 " autocomplete after -> "let OmniCpp_MayCompleteScope = 1 " autocomplete after :: "let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD", "cv", "boost"] "au BufNewFile,BufRead,BufEnter *.cpp,*.hpp,*.cc,*.hh set omnifunc=omni#cpp#complete#Main " automatically open and close the popup menu / preview window "au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif "set completeopt=menuone,menu,longest,preview "map :e %:p:s,.h$,.X123X,:s,.cpp$,.h,:s,.X123X$,.cpp, "map :e %:p:s,.hh$,.X123X,:s,.cc$,.hh,:s,.X123X$,.cc, " Uncomment the following to have Vim jump to the last position when " reopening a file if has("autocmd") au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g'\"" | endif endif " Indentation set shiftwidth=8 set softtabstop=8 if has("gui_running") " GUI is running or is about to start. " Maximize gvim window. " set lines=999 columns=999 "set lines=50 columns=100 "set guifont=Source\ Code\ Pro\ 11\ -1\ 5\ 50\ 0\ 0\ 0\ 1\ 0 "set guifont=Source\ Code\ Pro\ Medium\ 11 " GUI options. set guioptions-=m "remove menu bar set guioptions-=T "remove toolbar set guioptions-=r "remove right-hand scroll bar set guioptions-=L "remove left-hand scroll bar set guifont=Fira\ Code\ 10 "set guifont=Fira\ Mono\ 10 "set guifont=Source\ Code\ Pro\ 10 "set guifont=Terminus\ 11 set guiheadroom=0 endif " thesaurus and dictionary stuff "set dictionary+=/usr/share/dict/words "set thesaurus+=/home/julankin/.vim/mthes10/mthesaur.txt " tab navigation like firefox nnoremap :tabprevious nnoremap :tabnext nnoremap :tabnew inoremap :tabpreviousi inoremap :tabnexti inoremap :tabnew "set colorcolumn=80 " YouCompleteMe let g:ycm_add_preview_to_completeopt=0 let g:ycm_confirm_extra_conf=0 let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py' set completeopt-=preview set ssop-=options " do not store global and local values in a session set ssop-=folds " do not store folds " Fix backspace "set backspace=indent,eol,start " Syntastic "set statusline+=%#warningmsg# "set statusline+=%{SyntasticStatuslineFlag()} "set statusline+=%* "set laststatus=2 "let g:syntastic_always_populate_loc_list = 1 "let g:syntastic_auto_loc_list = 0 "let g:syntastic_check_on_open = 1 "let g:syntastic_check_on_wq = 0 "let g:syntastic_javascript_checkers = ['eslint'] map :GoTo " Toggle number :nmap :set invnumber " Toggle hlsearch :nnoremap :nohlsearch:echo autocmd BufRead,BufNewFile *.es6 setfiletype javascript "map :%!tidy -q --tidy-mark 0 2>/dev/null " Configure for jsdoc let g:jsdoc_enable_es6 = 1 " Remove trailing whitespace automatically autocmd BufWritePre *.js %s/\s\+$//e autocmd BufWritePre *.cpp %s/\s\+$//e set tabstop=4 set softtabstop=0 set expandtab set shiftwidth=2 set smarttab autocmd Filetype python setlocal ts=4 sw=4 sts=0 expandtab autocmd Filetype cpp setlocal ts=4 sw=4 sts=0 expandtab let g:UltiSnipsExpandTrigger="" let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsJumpBackwardTrigger="" augroup lexical autocmd! autocmd FileType markdown,mkd call lexical#init() autocmd FileType textile call lexical#init() autocmd FileType text call lexical#init({ 'spell': 0 }) augroup END