Dotfiles for my tiling window manager + terminal workflow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

178 lines
5.0 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. " set x=y {{{ "
  2. set relativenumber
  3. " set background=dark
  4. set background=light
  5. " set t_Co=256
  6. filetype plugin on
  7. syntax on
  8. set tabstop=4
  9. set tw=80
  10. set linebreak
  11. " set colorcolumn=80
  12. set shiftwidth=4
  13. set autoindent
  14. set mouse=c
  15. set clipboard+=unnamedplus
  16. set foldmethod=marker
  17. set linespace=5
  18. " set listchars=tab:\|\
  19. " set list
  20. " set cursorcolumn
  21. " set cursorline
  22. set timeoutlen=300
  23. set hlsearch
  24. " }}} set x=y "
  25. autocmd VimResized * wincmd =
  26. autocmd BufNewFile,BufRead .* set syntax=sh
  27. " vim-plug {{{ "
  28. " plug auto-install
  29. if empty(glob('~/.vim/autoload/plug.vim'))
  30. silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
  31. \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  32. autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
  33. endif
  34. call plug#begin('~/.vim/plugged')
  35. " prequisite for other plugins
  36. Plug 'vim-scripts/L9'
  37. " find files from within Vim
  38. " Plug 'vim-scripts/FuzzyFinder'
  39. " Gotham color scheme
  40. " Plug 'whatyouhide/vim-gotham'
  41. " collection of Vim color schemes
  42. Plug 'flazz/vim-colorschemes'
  43. " preview Vim color scheme easily within Vim
  44. Plug 'xolox/vim-colorscheme-switcher'
  45. " prerequisite for above plugin
  46. Plug 'xolox/vim-misc'
  47. " automatically save buffers upon returning to normal mode
  48. Plug '907th/vim-auto-save'
  49. let g:auto_save = 1
  50. " compile LaTeX PDF while writing the file
  51. Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' }
  52. " provides various functionality for writing LaTeX in Vim
  53. Plug 'lervag/vimtex'
  54. " auto-completion for various languages
  55. Plug 'Valloric/YouCompleteMe'
  56. " wrote short bits of text that expand into whatever you want
  57. " demo: https://www.youtube.com/watch?v=Zik6u0klD40
  58. Plug 'SirVer/ultisnips'
  59. " better key bindings for UltiSnipsExpandTrigger
  60. let g:UltiSnipsExpandTrigger = "<tab>"
  61. let g:UltiSnipsJumpForwardTrigger = "<tab>"
  62. let g:UltiSnipsJumpBackwardTrigger = "<C-tab>"
  63. " custom snippets
  64. Plug 'Kevin-Mok/vim-snippets'
  65. " to make YouCompleteMe work with UltiSnips (both use Tab)
  66. Plug 'ervandew/supertab'
  67. " make YCM compatible with UltiSnips (using supertab)
  68. let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
  69. let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
  70. let g:SuperTabDefaultCompletionType = '<C-n>'
  71. " easily comment/uncomment lines
  72. Plug 'scrooloose/nerdcommenter'
  73. let g:NERDTrimTrailingWhitespace = 1
  74. let g:NERDSpaceDelims = 1
  75. " add quotes/brackets around chunks of text easily
  76. Plug 'tpope/vim-surround'
  77. " navigate around file easily and precisely
  78. Plug 'easymotion/vim-easymotion'
  79. " status bar displaying various info about the current buffer
  80. Plug 'vim-airline/vim-airline'
  81. Plug 'vim-airline/vim-airline-themes'
  82. " continue Markdown lists when started
  83. Plug 'dkarter/bullets.vim'
  84. " coordinate Vim color scheme with terminal color scheme
  85. Plug 'dylanaraps/wal.vim'
  86. call plug#end()
  87. " colorscheme gotham256
  88. colorscheme wal
  89. " }}} vim-plug "
  90. " Mappings {{{ "
  91. map <F3> :wa<CR>
  92. map <F4> :wqa<CR>
  93. map <F5> :qa!<CR>
  94. map <F7> :AutoSaveToggle<CR>
  95. map <F9> :LLPStartPreview<CR>
  96. nnoremap <F10> :set paste<CR>p:set nopaste<CR>
  97. map <S-Enter> O<ESC>
  98. " For splits.
  99. nnoremap <C-Down> <C-W><C-J>
  100. nnoremap <C-Up> <C-W><C-K>
  101. nnoremap <C-Right> <C-W><C-L>
  102. nnoremap <C-Left> <C-W><C-H>
  103. " Maximize height/width.
  104. nnoremap <C-g> <C-W>_
  105. nnoremap <C-w> <C-W>|
  106. let mapleader="\<Space>"
  107. nnoremap <leader>e :e<CR>
  108. nnoremap <leader>ff :set foldmethod=marker<CR> zM
  109. nnoremap <leader>h :set hlsearch! hlsearch?<CR>
  110. nnoremap <leader>he :help
  111. nnoremap <leader>vhe :vert help
  112. nnoremap <leader>m :call cursor(0, len(getline('.'))/2)<CR>
  113. nnoremap <leader>nw :set nowrap<CR>
  114. nnoremap <leader>nv :echo has('nvim')<CR>
  115. nnoremap <leader>pli :PlugInstall<CR>
  116. nnoremap <leader>plc :PlugClean<CR>
  117. nnoremap <leader>plu :PlugUpdate<CR>
  118. nnoremap <leader>py :set tw=200<CR>
  119. nnoremap <leader>r q:i.,.+s///g<ESC>Fsi
  120. nnoremap <leader>rl q:i.s///g<left><left><left>
  121. nnoremap <leader>rv :source $MYVIMRC<CR>
  122. nnoremap <leader>R q:i%s///g<ESC>2F/i
  123. nnoremap <leader>s :set syn=sh<CR>
  124. nnoremap <leader>w Vgq
  125. nnoremap <leader>ww Vjgq
  126. nnoremap <leader>z za
  127. nnoremap <leader>y "+
  128. " }}} Mappings "
  129. " Local Mappings {{{ "
  130. let maplocalleader="-"
  131. autocmd Filetype c inoremap <localleader>s struct pixel
  132. autocmd Filetype tex inoremap <localleader>D \Delta
  133. autocmd Filetype tex inoremap <localleader>e \exists
  134. autocmd Filetype tex inoremap <localleader>fa \forall
  135. autocmd Filetype tex inoremap <localleader>g \geq
  136. autocmd Filetype tex inoremap <localleader>i \in
  137. autocmd Filetype tex inoremap <localleader>l \leq
  138. autocmd Filetype tex inoremap <localleader>lr \Leftrightarrow
  139. autocmd Filetype tex inoremap <localleader>n \neg
  140. autocmd Filetype tex inoremap <localleader>N \mathbb{N}
  141. autocmd Filetype tex inoremap <localleader>R \Rightarrow
  142. autocmd Filetype tex inoremap <localleader>st such that
  143. autocmd Filetype tex inoremap <localleader>t \times
  144. autocmd Filetype tex inoremap <localleader>T $T$
  145. autocmd Filetype tex inoremap <localleader>v \vee
  146. autocmd Filetype tex inoremap <localleader>w \wedge
  147. autocmd Filetype tex inoremap <localleader>x $x$-axis
  148. autocmd Filetype tex inoremap <localleader>y $y$-axis
  149. autocmd Filetype tex inoremap <localleader>Z \mathbb{Z}
  150. " }}} Local Mappings "