" set the runtime path to include Vundle and initialize "call has('python3') " Start plugins call plug#begin('~/.vim/plugged') " Sensible defaults Plug 'tpope/vim-sensible' " Javascript Plug 'heavenshell/vim-jsdoc', {'for': 'javascript'} Plug 'sheerun/vim-polyglot' " C/C++ Plug 'vim-scripts/DoxygenToolkit.vim', {'for': 'cpp'} " Rust Plug 'rust-lang/rust.vim', {'for': 'rust'} "Plug 'racer-rust/vim-racer', {'for': 'rust'} " Syntax checking Plug 'Valloric/YouCompleteMe' " alternative #1, full-blown "Plug 'w0rp/ale', " 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' Plug 'majutsushi/tagbar' " 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 " Magical color setup set t_Co=256 set background=dark syntax on let base16colorspace=256 colorscheme base16-default-dark " Other set encoding=utf-8 set autoindent " Automatically indent 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 set colorcolumn=80 " Set GUI parameters if has("gui_running") " 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=Fura\ Code\ Nerd\ Font\ 10 set guiheadroom=0 endif " Keybindings " Long list following " Indentation map mzgg=G`z map %s " NerdTree map :NERDTreeToggle imap :NERDTreeTogglei " NerdCommenter map ci inoremap za nnoremap za onoremap za vnoremap zf " tab navigation like firefox nnoremap :tabprevious nnoremap :tabnext nnoremap :tabnew inoremap :tabpreviousi inoremap :tabnexti inoremap :tabnew " Session parameters set ssop-=options " do not store global and local values in a session set ssop-=folds " do not store folds " Toggle number :nmap :set invnumber " Toggle hlsearch :nnoremap :nohlsearch:echo " 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 sane defaults for tabs autocmd Filetype python setlocal ts=4 sw=4 sts=0 expandtab autocmd Filetype cpp setlocal ts=4 sw=4 sts=0 expandtab autocmd Filetype javascript setlocal ts=2 sw=2 sts=0 expandtab autocmd Filetype vue setlocal ts=2 sw=2 sts=0 expandtab autocmd Filetype json setlocal ts=2 sw=2 sts=0 expandtab autocmd Filetype lua setlocal ts=2 sw=2 sts=0 expandtab autocmd Filetype html setlocal ts=4 sw=4 sts=0 expandtab " ultisnips 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 let g:ale_linters = { \ 'javascript': ['standard'], \ 'vue': ['standard --plugin html "**/*.{js,vue}"'] \} let g:racer_experimental_completer = 1 set completeopt+=preview