Advertisement
Guest User

Untitled

a guest
Aug 1st, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.06 KB | None | 0 0
  1. set nocompatible
  2.  
  3. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  4. " Plugins "
  5. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  6. call plug#begin('~/.vim/plugged')
  7.  
  8. " colorschemes
  9. Plug 'morhetz/gruvbox'
  10.  
  11. " highlighting and formatting
  12. "Plug 'scrooloose/nerdcommenter'
  13. Plug 'tomtom/tcomment_vim'
  14. Plug 'tpope/vim-surround'
  15. Plug 'junegunn/vim-easy-align'
  16. Plug 'tpope/vim-sleuth'
  17. Plug 'tpope/vim-unimpaired'
  18.  
  19. " extra language support
  20. Plug 'hynek/vim-python-pep8-indent'
  21. Plug 'kchmck/vim-coffee-script'
  22. Plug 'groenewege/vim-less'
  23. Plug 'tpope/vim-haml'
  24. Plug 'raimondi/delimitMate'
  25. Plug 'tpope/vim-endwise'
  26.  
  27. " code managing / searching / navigation
  28. " Plug 'majutsushi/tagbar'
  29. Plug 'ctrlpvim/ctrlp.vim'
  30. Plug 'tacahiroy/ctrlp-funky'
  31. Plug 'jeetsukumaran/vim-filebeagle'
  32. Plug 'justinmk/vim-sneak'
  33. " Plug 'mileszs/ack.vim'
  34. " Plug 'rking/ag.vim'
  35. " Plug 'airblade/vim-rooter'
  36. Plug 'tpope/vim-fugitive'
  37. Plug 'rking/ag.vim'
  38.  
  39. " statusline
  40. " Plug 'itchyny/lightline.vim'
  41. Plug 'bling/vim-airline'
  42.  
  43. " auto completion / shortcuts
  44. Plug 'Valloric/YouCompleteMe'
  45. Plug 'mhinz/vim-signify'
  46. Plug 'haya14busa/incsearch.vim'
  47.  
  48. " snippets
  49. Plug 'SirVer/ultisnips'
  50. Plug 'honza/vim-snippets'
  51.  
  52. call plug#end()
  53.  
  54.  
  55. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  56. " Visual Settings "
  57. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  58.  
  59. syntax on
  60. colorscheme gruvbox
  61. set background=dark
  62.  
  63. if !has('gui_running')
  64. let g:gruvbox_italic=0
  65. set t_Co=256
  66. endif
  67.  
  68. if has('gui_running')
  69. set guioptions=
  70. set guifont=Fira\ Mono:h14
  71. set cole=2
  72. let g:gruvbox_invert_selection=0
  73. let g:gruvbox_italicize_strings=1
  74. colorscheme gruvbox
  75. endif
  76.  
  77. set hidden
  78. set wildmenu
  79. set showcmd
  80. set clipboard=unnamed
  81.  
  82. filetype plugin indent on
  83. set backspace=indent,eol,start
  84. set autoindent
  85. set cindent
  86. set tabstop=2 shiftwidth=2 softtabstop=2 expandtab
  87.  
  88. set ruler
  89. set cursorline
  90. set scrolloff=20
  91.  
  92. set laststatus=2
  93. set confirm
  94.  
  95. set number
  96. " set foldcolumn=1
  97.  
  98. set wrap linebreak nolist
  99. set breakindent showbreak=…
  100.  
  101. " enable man pages
  102. "runtime ftplugin/man.vim
  103. "nnoremap K :Man <cword> <Cr>
  104.  
  105. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  106. " Vim Settings "
  107. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  108.  
  109. " mouse support
  110. set mouse=a
  111.  
  112. " spellcheck
  113. set spelllang=en
  114.  
  115. " yank to end of line
  116. map Y y$
  117.  
  118. " better leader
  119. map <space> <leader>
  120.  
  121. " always move up/down to the next visual line
  122. map j gj
  123. map k gk
  124.  
  125. " change behavior of move to beginning of line
  126. noremap 0 ^
  127. noremap ^ 0
  128.  
  129. " tab nav
  130. nnoremap <C-h> :tabp<Cr>
  131. nnoremap <C-l> :tabn<Cr>
  132.  
  133. " easier commands
  134. noremap ; :
  135. noremap <M-;> ;
  136.  
  137. " toggle buffers
  138. nnoremap <C-d> <C-^>
  139. inoremap <C-d> <esc><C-^>
  140.  
  141. " search settings
  142. set hlsearch
  143. set ignorecase
  144. set smartcase
  145. map / <Plug>(incsearch-forward)
  146. map ? <Plug>(incsearch-backward)
  147. map g/ <Plug>(incsearch-stay)
  148.  
  149. " set vim to save tmp files elsewhere
  150. set backupdir=/Users/jerry/.vim/backups/
  151. set directory=/Users/jerry/.vim/temps/
  152.  
  153. " folding
  154. function Fold()
  155. normal f{zf%
  156. endf
  157. command Fold call Fold()
  158. nmap zz :call Fold()
  159.  
  160. " persistent undo
  161. if exists("&undodir")
  162. set undofile
  163. let &undodir=&directory
  164. set undolevels=500
  165. set undoreload=500
  166. endif
  167.  
  168. " open vimrc
  169. nmap <leader>v :tabedit $MYVIMRC<CR>
  170.  
  171. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  172. " Plugin Settings "
  173. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  174.  
  175. " Airline
  176. set noshowmode
  177. let g:airline_powerline_fonts=1
  178. let g:airline_left_sep=' '
  179. let g:airline_right_sep=' '
  180.  
  181. " EasyAlign
  182. vmap <Enter> <Plug>(EasyAlign)
  183. nmap ga <Plug>(EasyAlign)
  184.  
  185. " YCM
  186. let g:ycm_confirm_extra_conf = 0
  187. let g:ycm_autoclose_preview_window_after_completion = 0
  188. let g:ycm_autoclose_preview_window_after_insertion = 1
  189. let g:ycm_show_diagnostics_ui = 0
  190.  
  191. " ultisnips
  192. let g:UltiSnipsExpandTrigger="<c-o>"
  193. let g:UltiSnipsJumpForwardTrigger="<c-n>"
  194. let g:UltiSnipsJumpBackwardTrigger="<c-m>"
  195.  
  196. " ctrlP
  197. let g:ctrlp_custom_ignore = '\v[\/](venv|node_modules|target|dist)|(\.(swp|ico|git|svn))$'
  198. let g:ctrlp_extensions = ['funky']
  199. nnoremap <C-f> :CtrlPFunky<Cr>
  200. nnoremap <C-b> :CtrlPBuffer<Cr>
  201.  
  202. " delimitMate
  203. let delimitMate_expand_cr = 2
  204. let delimitMate_expand_space = 1
  205. let delimitMate_expand_inside_quotes = 1
  206. let delimitMate_balance_matchingpairs = 1
  207.  
  208. " sneak
  209. let g:sneak#s_next = 1
  210. let g:sneak#streak = 1
  211.  
  212. " tagbar
  213. " nmap <C-t> :TagbarToggle<Cr>
  214. " let g:tagbar_autoclose = 1
  215. " let g:tagbar_sort = 0
  216. " let g:tagbar_autofocus = 1
  217.  
  218. " signify
  219. let g:signify_vcs_list = [ 'git', 'hg' ]
  220.  
  221. " incsearch
  222. let g:incsearch#auto_nohlsearch = 1
  223. map n <Plug>(incsearch-nohl-n)
  224. map N <Plug>(incsearch-nohl-N)
  225. map * <Plug>(incsearch-nohl-*)
  226. map # <Plug>(incsearch-nohl-#)
  227. map g* <Plug>(incsearch-nohl-g*)
  228. map g# <Plug>(incsearch-nohl-g#)
  229.  
  230. " The Silver Searcher
  231. if executable('ag')
  232. " Use ag over grep
  233. set grepprg=ag\ --nogroup\ --nocolor
  234.  
  235. " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
  236. let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
  237.  
  238. " ag is fast enough that CtrlP doesn't need to cache
  239. let g:ctrlp_use_caching = 0
  240. endif
  241.  
  242. command -nargs=+ -complete=file -bar Ag silent! grep! <args>|cwindow|redraw!
  243. nnoremap \\ :Ggrep<SPACE>
  244.  
  245. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  246. " Auto Commands "
  247. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  248.  
  249. " compile LaTeX on save
  250. autocmd BufWritePost *.tex call LatexCompile()
  251. function LatexCompile()
  252. cd %:p:h
  253. execute "!latexmk -pdf %"
  254. execute ":silent !latexmk -c %"
  255. endfunction
  256.  
  257. " compile XeLaTeX on save
  258. au BufNewFile,BufRead *.xtx set filetype=tex
  259. autocmd BufWritePost *.xtx call XeLatexCompile()
  260. function XeLatexCompile()
  261. cd %:p:h
  262. execute "!latexmk -xelatex -pdf %"
  263. execute ":silent !latexmk -c %"
  264. endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement