herophant

My .vimrc

Oct 12th, 2020 (edited)
110
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. " Global settings for all files (but may be overridden in ftplugin).
  2. " set relativenumber " Seems to cause extreme scroll lag in Vim 8
  3. set autoindent
  4. set autoread
  5. set backspace=indent,eol,start
  6. set clipboard=unnamedplus " system copy-paste support 1. get vim-gtk 2. set this 3. for WSL, vcxsrv
  7. set complete-=i
  8. set display+=lastline
  9. set expandtab " On pressing tab, insert 4 spaces
  10. set formatoptions+=j " Delete comment character when joining commented lines
  11. set ignorecase
  12. set incsearch
  13. set laststatus=2
  14. set mouse=nic          " Add mouse support for scrolling
  15. set nrformats-=octal
  16. set number
  17. set ruler
  18. set sessionoptions-=options
  19. set shiftwidth=4 " when indenting with '>', use 4 spaces width
  20. set smartcase
  21. set smarttab
  22. set splitright
  23. set tabstop=4 " show existing tab with 4 spaces width
  24. set viewoptions-=options
  25. set wildmenu
  26.  
  27. " let g:pathogen_disabled = []
  28. " call add(g:pathogen_disabled, 'tex-conceal.vim')
  29. " call add(g:pathogen_disabled, 'ultisnips')
  30. " let g:pathogen_blacklist = [ 'tex-conceal' ]
  31. execute pathogen#infect()
  32. silent! helptags ALL
  33.  
  34. " My custom mappings
  35. noremap <C-J> <C-W>j
  36. noremap <C-K> <C-W>k
  37. noremap <C-H> <C-W>h
  38. noremap <C-L> <C-W>l
  39.  
  40. inoremap <expr> <TAB> pumvisible() ? "\<C-y>" : "\<TAB>"
  41. inoremap <expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>"
  42.  
  43. if exists('g:loaded_sensible') || &compatible
  44.   finish
  45. else
  46.   let g:loaded_sensible = 'yes'
  47. endif
  48.  
  49. if has('autocmd')
  50.   filetype plugin indent on
  51. endif
  52. if has('syntax') && !exists('g:syntax_on')
  53.   syntax enable
  54. endif
  55.  
  56. if !has('nvim') && &ttimeoutlen == -1
  57.   set ttimeout
  58.   set ttimeoutlen=100
  59. endif
  60.  
  61. if !&scrolloff
  62.   set scrolloff=1
  63. endif
  64. if !&sidescrolloff
  65.   set sidescrolloff=5
  66. endif
  67.  
  68. if &encoding ==# 'latin1' && has('gui_running')
  69.   set encoding=utf-8
  70. endif
  71.  
  72. if &listchars ==# 'eol:$'
  73.   set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
  74. endif
  75.  
  76.  
  77. if has('path_extra')
  78.   setglobal tags-=./tags tags-=./tags; tags^=./tags;
  79. endif
  80.  
  81. if &shell =~# 'fish$' && (v:version < 704 || v:version == 704 && !has('patch276'))
  82.   set shell=/usr/bin/env\ bash
  83. endif
  84.  
  85. if &history < 1000
  86.   set history=1000
  87. endif
  88. if &tabpagemax < 50
  89.   set tabpagemax=50
  90. endif
  91. if !empty(&viminfo)
  92.   set viminfo^=!
  93. endif
  94.  
  95. " Allow color schemes to do bright colors without forcing bold.
  96. if &t_Co == 8 && $TERM !~# '^Eterm'
  97.   set t_Co=16
  98. endif
  99.  
  100. " Load matchit.vim, but only if the user hasn't installed a newer version.
  101. if !exists('g:loaded_matchit') && findfile('plugin/matchit.vim', &rtp) ==# ''
  102.   runtime! macros/matchit.vim
  103. endif
  104.  
  105. if empty(mapcheck('<C-U>', 'i'))
  106.   inoremap <C-U> <C-G>u<C-U>
  107. endif
  108. if empty(mapcheck('<C-W>', 'i'))
  109.   inoremap <C-W> <C-G>u<C-W>
  110. endif
  111.  
  112. colo ron
  113.  
  114. " lervag/vimtex options
  115. let g:tex_flavor = 'latex'
  116. let g:vimtex_view_method = 'zathura'
  117. let g:vimtex_view_forward_search_on_start = 1
  118. let g:vimtex_quickfix_mode = 0
  119. autocmd User VimtexEventQuit VimtexClean
  120.  
  121. " sirver/ultisnips options
  122. let g:UltiSnipsExpandTrigger = '<tab>'
  123. let g:UltiSnipsJumpForwardTrigger = '<tab>'
  124. let g:UltiSnipsJumpBackwardTrigger = '<s-tab>'
  125.  
  126. " keitaNakamura/tex-conceal.vim options
  127. set conceallevel=1
  128. let g:tex_conceal='abdmg'
  129. hi Conceal ctermbg=none
  130.  
  131. " Line Highlighting
  132. highlight ColorColumn ctermbg=magenta
  133. call matchadd('ColorColumn', '\%81v', 100)
  134.  
  135. " Airline
  136. set encoding=utf-8
  137. let g:airline#extensions#tabline#enabled = 1
  138. let g:airline_powerline_fonts = 1
  139. let g:airline#extensions#tabline#buffer_idx_mode = 1
  140.  
  141. " Syntastic
  142. let g:syntastic_enable_racket_racket_checker = 1
  143. let g:syntastic_mode_map = { 'mode': 'passive', 'active_filetypes': [],'passive_filetypes': [] }
  144. nnoremap <C-w>e :SyntasticCheck<CR>
  145.  
  146. " luochen1990/rainbow setup
  147. let g:rainbow_active = 1
  148. let g:rainbow_conf = {
  149. \   'separately': {
  150. \       '*': 0,
  151. \       'racket': {},
  152. \   }
  153. \}
  154. """""""""""""""""""""""""
  155.  
  156. " Define map leader
  157. let mapleader = " "
  158. let g:mapleader = " "
  159.  
  160. " Fast editing of the .vimrc and other things
  161. nnoremap <leader>e :e! ~/.vimrc<CR>
  162. nnoremap <leader>u :e! ~/.vim/UltiSnips/tex.snippets<CR>
  163. nnoremap <leader>w :w<CR>
  164. nnoremap <leader>s :SyntasticCheck<CR>
  165.  
  166. if &diff
  167.     highlight DiffAdd    cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
  168.     highlight DiffDelete cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
  169.     highlight DiffChange cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
  170.     highlight DiffText   cterm=bold ctermfg=10 ctermbg=88 gui=none guifg=bg guibg=Red
  171. endif
  172.  
  173. " autocmd InsertLeave * write
  174.  
  175. " <CR> will select current selection from pop-up menu Ctrl-N search
  176. inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
  177.  
  178. " Insert lambda with <C-\>
  179. inoremap <C-\> <C-v>u03bb
  180.  
RAW Paste Data