Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set nocompatible
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " Plugins "
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- call plug#begin('~/.vim/plugged')
- " colorschemes
- Plug 'morhetz/gruvbox'
- " highlighting and formatting
- "Plug 'scrooloose/nerdcommenter'
- Plug 'tomtom/tcomment_vim'
- Plug 'tpope/vim-surround'
- Plug 'junegunn/vim-easy-align'
- Plug 'tpope/vim-sleuth'
- Plug 'tpope/vim-unimpaired'
- " extra language support
- Plug 'hynek/vim-python-pep8-indent'
- Plug 'kchmck/vim-coffee-script'
- Plug 'groenewege/vim-less'
- Plug 'tpope/vim-haml'
- Plug 'raimondi/delimitMate'
- Plug 'tpope/vim-endwise'
- " code managing / searching / navigation
- " Plug 'majutsushi/tagbar'
- Plug 'ctrlpvim/ctrlp.vim'
- Plug 'tacahiroy/ctrlp-funky'
- Plug 'jeetsukumaran/vim-filebeagle'
- Plug 'justinmk/vim-sneak'
- " Plug 'mileszs/ack.vim'
- " Plug 'rking/ag.vim'
- " Plug 'airblade/vim-rooter'
- Plug 'tpope/vim-fugitive'
- Plug 'rking/ag.vim'
- " statusline
- " Plug 'itchyny/lightline.vim'
- Plug 'bling/vim-airline'
- " auto completion / shortcuts
- Plug 'Valloric/YouCompleteMe'
- Plug 'mhinz/vim-signify'
- Plug 'haya14busa/incsearch.vim'
- " snippets
- Plug 'SirVer/ultisnips'
- Plug 'honza/vim-snippets'
- call plug#end()
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " Visual Settings "
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- syntax on
- colorscheme gruvbox
- set background=dark
- if !has('gui_running')
- let g:gruvbox_italic=0
- set t_Co=256
- endif
- if has('gui_running')
- set guioptions=
- set guifont=Fira\ Mono:h14
- set cole=2
- let g:gruvbox_invert_selection=0
- let g:gruvbox_italicize_strings=1
- colorscheme gruvbox
- endif
- set hidden
- set wildmenu
- set showcmd
- set clipboard=unnamed
- filetype plugin indent on
- set backspace=indent,eol,start
- set autoindent
- set cindent
- set tabstop=2 shiftwidth=2 softtabstop=2 expandtab
- set ruler
- set cursorline
- set scrolloff=20
- set laststatus=2
- set confirm
- set number
- " set foldcolumn=1
- set wrap linebreak nolist
- set breakindent showbreak=…
- " enable man pages
- "runtime ftplugin/man.vim
- "nnoremap K :Man <cword> <Cr>
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " Vim Settings "
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " mouse support
- set mouse=a
- " spellcheck
- set spelllang=en
- " yank to end of line
- map Y y$
- " better leader
- map <space> <leader>
- " always move up/down to the next visual line
- map j gj
- map k gk
- " change behavior of move to beginning of line
- noremap 0 ^
- noremap ^ 0
- " tab nav
- nnoremap <C-h> :tabp<Cr>
- nnoremap <C-l> :tabn<Cr>
- " easier commands
- noremap ; :
- noremap <M-;> ;
- " toggle buffers
- nnoremap <C-d> <C-^>
- inoremap <C-d> <esc><C-^>
- " search settings
- set hlsearch
- set ignorecase
- set smartcase
- map / <Plug>(incsearch-forward)
- map ? <Plug>(incsearch-backward)
- map g/ <Plug>(incsearch-stay)
- " set vim to save tmp files elsewhere
- set backupdir=/Users/jerry/.vim/backups/
- set directory=/Users/jerry/.vim/temps/
- " folding
- function Fold()
- normal f{zf%
- endf
- command Fold call Fold()
- nmap zz :call Fold()
- " persistent undo
- if exists("&undodir")
- set undofile
- let &undodir=&directory
- set undolevels=500
- set undoreload=500
- endif
- " open vimrc
- nmap <leader>v :tabedit $MYVIMRC<CR>
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " Plugin Settings "
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " Airline
- set noshowmode
- let g:airline_powerline_fonts=1
- let g:airline_left_sep=' '
- let g:airline_right_sep=' '
- " EasyAlign
- vmap <Enter> <Plug>(EasyAlign)
- nmap ga <Plug>(EasyAlign)
- " YCM
- let g:ycm_confirm_extra_conf = 0
- let g:ycm_autoclose_preview_window_after_completion = 0
- let g:ycm_autoclose_preview_window_after_insertion = 1
- let g:ycm_show_diagnostics_ui = 0
- " ultisnips
- let g:UltiSnipsExpandTrigger="<c-o>"
- let g:UltiSnipsJumpForwardTrigger="<c-n>"
- let g:UltiSnipsJumpBackwardTrigger="<c-m>"
- " ctrlP
- let g:ctrlp_custom_ignore = '\v[\/](venv|node_modules|target|dist)|(\.(swp|ico|git|svn))$'
- let g:ctrlp_extensions = ['funky']
- nnoremap <C-f> :CtrlPFunky<Cr>
- nnoremap <C-b> :CtrlPBuffer<Cr>
- " delimitMate
- let delimitMate_expand_cr = 2
- let delimitMate_expand_space = 1
- let delimitMate_expand_inside_quotes = 1
- let delimitMate_balance_matchingpairs = 1
- " sneak
- let g:sneak#s_next = 1
- let g:sneak#streak = 1
- " tagbar
- " nmap <C-t> :TagbarToggle<Cr>
- " let g:tagbar_autoclose = 1
- " let g:tagbar_sort = 0
- " let g:tagbar_autofocus = 1
- " signify
- let g:signify_vcs_list = [ 'git', 'hg' ]
- " incsearch
- let g:incsearch#auto_nohlsearch = 1
- map n <Plug>(incsearch-nohl-n)
- map N <Plug>(incsearch-nohl-N)
- map * <Plug>(incsearch-nohl-*)
- map # <Plug>(incsearch-nohl-#)
- map g* <Plug>(incsearch-nohl-g*)
- map g# <Plug>(incsearch-nohl-g#)
- " The Silver Searcher
- if executable('ag')
- " Use ag over grep
- set grepprg=ag\ --nogroup\ --nocolor
- " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
- let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
- " ag is fast enough that CtrlP doesn't need to cache
- let g:ctrlp_use_caching = 0
- endif
- command -nargs=+ -complete=file -bar Ag silent! grep! <args>|cwindow|redraw!
- nnoremap \\ :Ggrep<SPACE>
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " Auto Commands "
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " compile LaTeX on save
- autocmd BufWritePost *.tex call LatexCompile()
- function LatexCompile()
- cd %:p:h
- execute "!latexmk -pdf %"
- execute ":silent !latexmk -c %"
- endfunction
- " compile XeLaTeX on save
- au BufNewFile,BufRead *.xtx set filetype=tex
- autocmd BufWritePost *.xtx call XeLatexCompile()
- function XeLatexCompile()
- cd %:p:h
- execute "!latexmk -xelatex -pdf %"
- execute ":silent !latexmk -c %"
- endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement