" set x=y {{{ " set relativenumber " set background=dark set background=light " set t_Co=256 filetype plugin on syntax on set tabstop=4 set tw=80 set linebreak " set colorcolumn=80 set shiftwidth=4 set autoindent set mouse=c set clipboard+=unnamedplus set foldmethod=marker set linespace=5 " set listchars=tab:\|\ " set list " set cursorcolumn " set cursorline set timeoutlen=500 set hlsearch " }}} set x=y " autocmd VimResized * wincmd = autocmd BufNewFile,BufRead .* set syntax=sh " vim-plug {{{ " " plug auto-install if empty(glob('~/.vim/autoload/plug.vim')) silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim autocmd VimEnter * PlugInstall --sync | source $MYVIMRC endif call plug#begin('~/.vim/plugged') " prequisite for other plugins Plug 'vim-scripts/L9' " find files from within Vim " Plug 'vim-scripts/FuzzyFinder' " Gotham color scheme " Plug 'whatyouhide/vim-gotham' " collection of Vim color schemes Plug 'flazz/vim-colorschemes' " preview Vim color scheme easily within Vim Plug 'xolox/vim-colorscheme-switcher' " prerequisite for above plugin Plug 'xolox/vim-misc' " automatically save buffers upon returning to normal mode Plug '907th/vim-auto-save' let g:auto_save = 1 " compile LaTeX PDF while writing the file Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' } " provides various functionality for writing LaTeX in Vim Plug 'lervag/vimtex' " auto-completion for various languages Plug 'Valloric/YouCompleteMe' " wrote short bits of text that expand into whatever you want " demo: https://www.youtube.com/watch?v=Zik6u0klD40 Plug 'SirVer/ultisnips' " better key bindings for UltiSnipsExpandTrigger let g:UltiSnipsExpandTrigger = "" let g:UltiSnipsJumpForwardTrigger = "" let g:UltiSnipsJumpBackwardTrigger = "" " custom snippets Plug 'Kevin-Mok/vim-snippets' " to make YouCompleteMe work with UltiSnips (both use Tab) Plug 'ervandew/supertab' " make YCM compatible with UltiSnips (using supertab) let g:ycm_key_list_select_completion = ['', ''] let g:ycm_key_list_previous_completion = ['', ''] let g:SuperTabDefaultCompletionType = '' " easily comment/uncomment lines Plug 'scrooloose/nerdcommenter' let g:NERDTrimTrailingWhitespace = 1 let g:NERDSpaceDelims = 1 " add quotes/brackets around chunks of text easily Plug 'tpope/vim-surround' " navigate around file easily and precisely Plug 'easymotion/vim-easymotion' " status bar displaying various info about the current buffer Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' " continue Markdown lists when started Plug 'dkarter/bullets.vim' " coordinate Vim color scheme with terminal color scheme Plug 'dylanaraps/wal.vim' " repeat plugin commands Plug 'tpope/vim-repeat' call plug#end() " colorscheme gotham256 colorscheme wal " }}} vim-plug " " Mappings {{{ " " function keys {{{ " map :wa map :wqa map :qa! map :make -C ~/Documents/resume cv map :AutoSaveToggle map :LLPStartPreview nnoremap :set paste"+p:set nopaste " }}} function keys " map O " splits {{{ " nnoremap nnoremap nnoremap nnoremap " Maximize height/width. nnoremap _ nnoremap | " }}} splits " " leader mappings {{{ " let mapleader="\" " reload file nnoremap e :e " reload folds nnoremap ff :set foldmethod=marker zM " toggle search highlighting nnoremap h :set hlsearch! hlsearch? " help nnoremap he :help nnoremap vhe :vert help " move cursor to middle of line nnoremap m :call cursor(0, len(getline('.'))/2) " don't wrap lines nnoremap nw :set nowrap " check if in neovim nnoremap nv :echo has('nvim') " Plug commands nnoremap pli :PlugInstall nnoremap plc :PlugClean nnoremap plu :PlugUpdate " don't break lines nnoremap py :set tw=200 " replace in next x lines nnoremap r q:i.,.+s///gFsi " replace in line nnoremap rl q:i.s///g " reload vim config nnoremap rv :source $MYVIMRC " replace in entire file nnoremap R q:i%s///g2F/i " set syntax to shell (for dotfiles) nnoremap s :set syn=sh " replace bars/underscores in URL nnoremap url :.s/\([-_]\)/\\\1/g " format current line nnoremap w Vgq " format this and next line nnoremap ww Vjgq " toggle fold nnoremap z za " copy next thing to system clipboard nnoremap y "+ " }}} leader mappings " " }}} Mappings " " Local Mappings {{{ " let maplocalleader="-" autocmd Filetype c inoremap s struct pixel " tex {{{ " autocmd Filetype tex inoremap D \Delta autocmd Filetype tex inoremap e \exists autocmd Filetype tex inoremap fa \forall autocmd Filetype tex inoremap g \geq autocmd Filetype tex inoremap i \in autocmd Filetype tex inoremap l \leq autocmd Filetype tex inoremap lr \Leftrightarrow autocmd Filetype tex inoremap n \neg autocmd Filetype tex inoremap N \mathbb{N} autocmd Filetype tex inoremap R \Rightarrow autocmd Filetype tex inoremap st such that autocmd Filetype tex inoremap t \times autocmd Filetype tex inoremap T $T$ autocmd Filetype tex inoremap v \vee autocmd Filetype tex inoremap w \wedge autocmd Filetype tex inoremap x $x$-axis autocmd Filetype tex inoremap y $y$-axis autocmd Filetype tex inoremap Z \mathbb{Z} " }}} tex " " }}} Local Mappings "