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.

138 lines
4.1 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. Plug 'vim-scripts/L9'
  36. " Plug 'vim-scripts/FuzzyFinder'
  37. Plug 'whatyouhide/vim-gotham'
  38. Plug 'flazz/vim-colorschemes'
  39. Plug '907th/vim-auto-save'
  40. let g:auto_save = 1
  41. Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' }
  42. Plug 'lervag/vimtex'
  43. Plug 'Valloric/YouCompleteMe'
  44. Plug 'Kevin-Mok/vim-snippets'
  45. Plug 'SirVer/ultisnips'
  46. Plug 'ervandew/supertab'
  47. Plug 'scrooloose/nerdcommenter'
  48. let g:NERDTrimTrailingWhitespace = 1
  49. let g:NERDSpaceDelims = 1
  50. Plug 'xolox/vim-misc'
  51. Plug 'xolox/vim-colorscheme-switcher'
  52. Plug 'tpope/vim-surround'
  53. Plug 'easymotion/vim-easymotion'
  54. Plug 'vim-airline/vim-airline'
  55. Plug 'vim-airline/vim-airline-themes'
  56. Plug 'dkarter/bullets.vim'
  57. " }}} vim-plug "
  58. " YCM/UltiSnips {{{ "
  59. " make YCM compatible with UltiSnips (using supertab)
  60. let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
  61. let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
  62. let g:SuperTabDefaultCompletionType = '<C-n>'
  63. " better key bindings for UltiSnipsExpandTrigger
  64. let g:UltiSnipsExpandTrigger = "<tab>"
  65. let g:UltiSnipsJumpForwardTrigger = "<tab>"
  66. let g:UltiSnipsJumpBackwardTrigger = "<C-tab>"
  67. " }}} YCM/UltiSnips "
  68. call plug#end()
  69. colorscheme gotham256
  70. " Mappings {{{ "
  71. map <F3> :wa<CR>
  72. map <F4> :wqa<CR>
  73. map <F5> :qa!<CR>
  74. map <F7> :AutoSaveToggle<CR>
  75. map <F9> :LLPStartPreview<CR>
  76. nnoremap <F10> :set paste<CR>p:set nopaste<CR>
  77. map <S-Enter> O<ESC>
  78. " For splits.
  79. nnoremap <C-Down> <C-W><C-J>
  80. nnoremap <C-Up> <C-W><C-K>
  81. nnoremap <C-Right> <C-W><C-L>
  82. nnoremap <C-Left> <C-W><C-H>
  83. " Maximize height/width.
  84. nnoremap <C-g> <C-W>_
  85. nnoremap <C-w> <C-W>|
  86. let mapleader="\<Space>"
  87. nnoremap <leader>e :e<CR>
  88. nnoremap <leader>ff :set foldmethod=marker<CR> zM
  89. nnoremap <leader>h :set hlsearch! hlsearch?<CR>
  90. nnoremap <leader>he :help
  91. nnoremap <leader>vhe :vert help
  92. nnoremap <leader>m :call cursor(0, len(getline('.'))/2)<CR>
  93. nnoremap <leader>nw :set nowrap<CR>
  94. nnoremap <leader>pli :PlugInstall<CR>
  95. nnoremap <leader>plc :PlugClean<CR>
  96. nnoremap <leader>plu :PlugUpdate<CR>
  97. nnoremap <leader>py :set tw=200<CR>
  98. nnoremap <leader>r q:i.,.+s///g<ESC>Fsi
  99. nnoremap <leader>rl q:i.s///g<left><left><left>
  100. nnoremap <leader>rv :source $MYVIMRC<CR>
  101. nnoremap <leader>R q:i%s///g<ESC>2F/i
  102. nnoremap <leader>s :set syn=sh<CR>
  103. nnoremap <leader>w Vgq
  104. nnoremap <leader>ww Vjgq
  105. nnoremap <leader>z za
  106. " }}} Mappings "
  107. " Local Mappings {{{ "
  108. let maplocalleader="-"
  109. autocmd Filetype c inoremap <localleader>s struct pixel
  110. autocmd Filetype tex inoremap <localleader>D \Delta
  111. autocmd Filetype tex inoremap <localleader>e \exists
  112. autocmd Filetype tex inoremap <localleader>fa \forall
  113. autocmd Filetype tex inoremap <localleader>g \geq
  114. autocmd Filetype tex inoremap <localleader>i \in
  115. autocmd Filetype tex inoremap <localleader>l \leq
  116. autocmd Filetype tex inoremap <localleader>lr \Leftrightarrow
  117. autocmd Filetype tex inoremap <localleader>n \neg
  118. autocmd Filetype tex inoremap <localleader>N \mathbb{N}
  119. autocmd Filetype tex inoremap <localleader>R \Rightarrow
  120. autocmd Filetype tex inoremap <localleader>st such that
  121. autocmd Filetype tex inoremap <localleader>t \times
  122. autocmd Filetype tex inoremap <localleader>T $T$
  123. autocmd Filetype tex inoremap <localleader>v \vee
  124. autocmd Filetype tex inoremap <localleader>w \wedge
  125. autocmd Filetype tex inoremap <localleader>x $x$-axis
  126. autocmd Filetype tex inoremap <localleader>y $y$-axis
  127. autocmd Filetype tex inoremap <localleader>Z \mathbb{Z}
  128. " }}} Local Mappings "