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.
 
 

419 lines
10 KiB

  1. " ===== hasufell's vimrc ))))
  2. " plugin stuff
  3. filetype plugin on
  4. filetype indent on
  5. " Section pathogen
  6. " let g:pathogen_disabled = []
  7. " call add(g:pathogen_disabled, 'syntastic')
  8. " call pathogen#infect()
  9. " vim-plug settings (Plugin declaration)
  10. call plug#begin('~/.vim/plugged')
  11. Plug 'mileszs/ack.vim'
  12. Plug 'romainl/Apprentice'
  13. Plug 'chriskempson/base16-vim'
  14. Plug 'fneu/breezy'
  15. Plug 'vim-scripts/cmdalias.vim'
  16. Plug 'Raimondi/delimitMate'
  17. Plug 'romainl/Disciple'
  18. Plug 'vim-scripts/genindent.vim'
  19. Plug 'sjl/gundo.vim'
  20. Plug 'idris-hackers/idris-vim'
  21. Plug 'wimstefan/Lightning'
  22. Plug 'vim-scripts/LustyJuggler'
  23. Plug 'yegappan/mru'
  24. Plug 'scrooloose/nerdcommenter'
  25. Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
  26. Plug 'NLKNguyen/papercolor-theme'
  27. Plug 'powerline/powerline', {
  28. \ 'branch': 'develop',
  29. \ 'do': 'python setup.py install --user',
  30. \ 'rtp': 'powerline/bindings/vim',
  31. \ }
  32. Plug 'vim-scripts/promela.vim'
  33. Plug 'AndrewRadev/simple_bookmarks.vim'
  34. Plug 'Keithbsmiley/swift.vim'
  35. Plug 'majutsushi/tagbar'
  36. Plug 'ternjs/tern_for_vim'
  37. Plug 'flazz/vim-colorschemes'
  38. Plug 'reedes/vim-colors-pencil'
  39. Plug 'altercation/vim-colors-solarized'
  40. Plug 'xolox/vim-easytags'
  41. Plug 'tpope/vim-fugitive'
  42. Plug 'whatyouhide/vim-gotham'
  43. Plug 'noahfrederick/vim-hemisu'
  44. Plug 'nathanaelkane/vim-indent-guides'
  45. Plug 'xolox/vim-misc'
  46. Plug 'Shougo/vimproc.vim', {'do' : 'make'}
  47. Plug 'tpope/vim-rhubarb'
  48. " local_vimrc
  49. Plug 'LucHermitte/lh-vim-lib'
  50. Plug 'LucHermitte/local_vimrc'
  51. " LSP
  52. " setting this per-language breaks "let g:LanguageClient_autoStart = 1",
  53. Plug 'autozimu/LanguageClient-neovim', {
  54. \ 'branch': 'next',
  55. \ 'do': 'bash install.sh',
  56. \ }
  57. " (Optional) Multi-entry selection UI.
  58. " Plug 'junegunn/fzf', { 'for': 'haskell' }
  59. " autocomplet
  60. " Plug 'Shougo/deoplete.nvim', { 'for': 'haskell' }
  61. " Plug 'roxma/nvim-yarp', { 'for': 'haskell' }
  62. " Plug 'roxma/vim-hug-neovim-rpc', { 'for': 'haskell' }
  63. " linting/compilation
  64. Plug 'w0rp/ale'
  65. " completion
  66. Plug 'Valloric/YouCompleteMe', { 'do': './install.py --clang-completer --go-completer --rust-completer --system-boost --system-libclang',
  67. \ 'for': ['haskell', 'c', 'python', 'sh', 'go', 'clojure', 'rust'],
  68. \ }
  69. " haskell
  70. Plug 'eagletmt/ghcmod-vim', { 'for': 'haskell' }
  71. Plug 'eagletmt/neco-ghc', { 'for': 'haskell' }
  72. Plug 'lukerandall/haskellmode-vim', { 'for': 'haskell' }
  73. Plug 'raichoo/haskell-vim', { 'for': 'haskell' }
  74. Plug 'ucsd-progsys/liquid-types.vim', { 'for': 'haskell' }
  75. Plug 'bitc/lushtags', {
  76. \ 'do': 'bash -c \"cabal clean && cabal sandbox delete && cabal sandbox init && cabal install && cp .cabal-sandbox/bin/lushtags ~/.cabal/bin/lushtags\"',
  77. \ 'for': 'haskell',
  78. \ }
  79. " Plug 'timmytofu/vim-cabal-context', { 'for': 'haskell' }
  80. Plug 'itchyny/vim-haskell-indent', { 'for': 'haskell' }
  81. Plug 'dan-t/vim-hsimport', { 'for': 'haskell' }
  82. " clojure
  83. " Plug '~/.vim/unmanaged-vim-plug/paredit', { 'for': 'clojure' }
  84. " Plug '~/.vim/unmanaged-vim-plug/tslime', { 'for': 'clojure' }
  85. Plug 'guns/vim-slamhound', {'for': 'clojure'}
  86. Plug 'guns/vim-sexp', {'for': 'clojure'}
  87. Plug 'tpope/vim-sexp-mappings-for-regular-people', {'for': 'clojure'}
  88. Plug 'kovisoft/paredit', {'for': 'clojure'}
  89. Plug 'tpope/vim-salve', { 'for': 'clojure' }
  90. Plug 'tpope/vim-projectionist', { 'for': 'clojure' }
  91. Plug 'tpope/vim-dispatch', { 'for': 'clojure' }
  92. Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
  93. Plug 'luochen1990/rainbow', { 'for': 'clojure' }
  94. Plug 'typedclojure/vim-typedclojure', {'for': 'clojure'}
  95. " go
  96. Plug 'garyburd/go-explorer', { 'for': 'go' }
  97. Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries', 'for': 'go' }
  98. " rust
  99. Plug 'rhysd/rust-doc.vim', { 'for': 'rust' }
  100. Plug 'rust-lang/rust.vim', { 'for': 'rust' }
  101. " javascript
  102. Plug 'moll/vim-node', { 'for': 'javascript' }
  103. Plug 'pangloss/vim-javascript', { 'for': 'javascript' }
  104. " python
  105. Plug 'icedwater/vimpython', { 'for': 'python' }
  106. " scala
  107. Plug 'derekwyatt/vim-scala', { 'for': 'scala' }
  108. " unmanaged
  109. Plug '~/.vim/unmanaged-vim-plug/bufonly'
  110. Plug '~/.vim/unmanaged-vim-plug/colorschemedegrade'
  111. Plug '~/.vim/unmanaged-vim-plug/fontzoom'
  112. Plug '~/.vim/unmanaged-vim-plug/fuzzyfinder'
  113. Plug '~/.vim/unmanaged-vim-plug/L9'
  114. Plug '~/.vim/unmanaged-vim-plug/log'
  115. Plug '~/.vim/unmanaged-vim-plug/ScrollColor'
  116. Plug '~/.vim/unmanaged-vim-plug/txtfmt'
  117. " Initialize plugin system
  118. call plug#end()
  119. " ===== further plugin initialization =====
  120. so ~/.vim/plugged/cmdalias.vim/plugin/cmdalias.vim
  121. "powerline
  122. python from powerline.vim import setup as powerline_setup
  123. python powerline_setup()
  124. python del powerline_setup
  125. set laststatus=2
  126. " lj
  127. let g:LustyJugglerSuppressRubyWarning = 1
  128. " global settings
  129. set foldmethod=syntax "fold based on indent
  130. set foldnestmax=10 "deepest fold is 10 levels
  131. set nofoldenable "dont fold by default
  132. set foldlevel=1 "this is just what i useset directory=~/.vimtmp
  133. set mouse=a
  134. set autoread
  135. set number
  136. set encoding=utf8
  137. set guifont=Monospace\ 14
  138. set clipboard=unnamedplus
  139. set textwidth=0
  140. set tabstop=4
  141. set shiftwidth=4
  142. set directory=~/.vimtmp
  143. set modeline
  144. set modelines=1
  145. let g:nickID = "hasufell"
  146. " haskellmode, needs to load early
  147. let g:haddock_browser='/usr/bin/firefox'
  148. let g:haddock_browser_callformat='%s file://%s >/dev/null 2>&1 &'
  149. " ==== conque ====
  150. " command aliases
  151. call CmdAlias('t','tabnew')
  152. " call CmdAlias('cmd','ConqueTermSplit')
  153. " call CmdAlias('bash','ConqueTermSplit bash<CR>')
  154. call CmdAlias('openall','tab sball')
  155. call CmdAlias('stripw','call StripTrailingWhitespaces()<CR>')
  156. call CmdAlias('hotkeys', 'tabnew ~/.vim/hotkeys')
  157. call CmdAlias('TC', 'call ToggleComment()<CR>')
  158. call CmdAlias('TF', 'call ToggleFoldText()<CR>')
  159. call CmdAlias('ctags', '!/usr/bin/ctags -R --langmap=c:.c.h --c++-kinds=+p --c-kinds=+p+x --fields=+i+a+S+t+l+m+n --extra=+q .<CR>')
  160. " cabbrev git Git
  161. " Disable annoying auto line break
  162. fu! DisableBr()
  163. set wrap
  164. set linebreak
  165. set nolist " list disables linebreak
  166. set textwidth=0
  167. set wrapmargin=0
  168. set fo-=t
  169. endfu
  170. " Disable line breaks for all file types
  171. au BufNewFile,BufRead *.* call DisableBr()
  172. " ==========copy/paste===========
  173. function! Paste(mode)
  174. if a:mode == "v"
  175. normal gv
  176. normal "_d
  177. normal "+gP
  178. normal l
  179. elseif a:mode == "i"
  180. set virtualedit=all
  181. normal `^"+gP
  182. let &virtualedit = ""
  183. endif
  184. endfunction
  185. " ======select all=======
  186. function! Select()
  187. set virtualedit=all
  188. normal `^ggVG
  189. let &virtualedit = ""
  190. endfunction
  191. " =======================
  192. " don't yank to buffer on deletion
  193. " vnoremap d "_d
  194. " nnoremap d "_d
  195. vnoremap x "_x
  196. nnoremap x "_x
  197. " Syntax
  198. syntax enable
  199. " ==== delimitMate ====
  200. let g:delimitMate_matchpairs = "(:),[:],{:}"
  201. let g:delimitMate_expand_cr = 1
  202. let g:delimitMate_expand_space = 1
  203. let g:delimitMate_autoclose = 1
  204. " pane navigation
  205. " Use ctrl-[hjkl] to select the active split!
  206. let g:C_Ctrl_j = 'off'
  207. let g:BASH_Ctrl_j = 'off'
  208. " ==========colors===========
  209. "set t_Co=256
  210. "let g:solarized_termcolors=256
  211. if has('gui_running')
  212. set background=dark
  213. colorscheme solarized
  214. else
  215. set background=dark
  216. colorscheme solarized
  217. " colorscheme dante
  218. endif
  219. " ===========================
  220. " Solarized stuff
  221. " let g:solarized_termtrans=0
  222. " let g:solarized_degrade=0
  223. " let g:solarized_bold=1
  224. " let g:solarized_underline=1
  225. " let g:solarized_italic=1
  226. " let g:solarized_termcolors=16
  227. " let g:solarized_contrast="normal"
  228. let g:solarized_visibility="high"
  229. " let g:solarized_diffmode="normal"
  230. " let g:solarized_hitrail=0
  231. let g:solarized_menu=1
  232. try
  233. lang en_US
  234. catch
  235. endtry
  236. " ====== traling whitespace =====
  237. fun! ShowTrailingWhitespace(pattern)
  238. if &ft == 'conque_term'
  239. call clearmatches()
  240. return
  241. endif
  242. if &ft == 'diff'
  243. call clearmatches()
  244. return
  245. endif
  246. let str=a:pattern
  247. if str == '1'
  248. match ExtraWhitespace /\s\+$/
  249. elseif str == '2'
  250. call clearmatches()
  251. " match ExtraWhitespace /\s\+\%#\@<!$/
  252. elseif str == '3'
  253. match ExtraWhitespace /\s\+$/
  254. endif
  255. endfun
  256. highlight ExtraWhitespace ctermbg=red guibg=red
  257. match ExtraWhitespace /\s\+$/
  258. autocmd BufWinEnter * call ShowTrailingWhitespace('1')
  259. autocmd InsertEnter * call ShowTrailingWhitespace('2')
  260. autocmd InsertLeave * call ShowTrailingWhitespace('3')
  261. autocmd BufWinLeave * call clearmatches()
  262. fun! StripTrailingWhitespaces()
  263. let l = line(".")
  264. let c = col(".")
  265. %s/\s\+$//e
  266. call cursor(l, c)
  267. endfun
  268. " ===========================
  269. " LSP
  270. let g:LanguageClient_autoStart = 0
  271. " youcompleteme
  272. let g:ycm_filetype_blacklist = {
  273. \ 'notes' : 1,
  274. \ 'markdown' : 1,
  275. \ 'text' : 1,
  276. \ 'java' : 1,
  277. \}
  278. let g:ycm_confirm_extra_conf = 0
  279. let g:ycm_global_ycm_extra_conf='~/.vim/.ycm_extra_conf.py'
  280. let g:ycm_collect_identifiers_from_tags_files = 1
  281. let g:ycm_seed_identifiers_with_syntax = 0
  282. " let g:ycm_always_populate_location_list = 1
  283. let g:ycm_autoclose_preview_window_after_completion = 1
  284. let g:ycm_key_invoke_completion = '<C-Space>'
  285. let g:ycm_key_list_select_completion = ['<TAB>']
  286. let g:ycm_key_list_previous_completion = ['<S-TAB>']
  287. " nnoremap <F4> :YcmCompleter GoToDefinition<CR>
  288. let g:ycm_server_log_level = 'error'
  289. let g:ycm_semantic_triggers = {'haskell' : ['. ', '$ ']}
  290. let g:ycm_goto_buffer_command = 'horizontal-split'
  291. " commenting
  292. let NERDSpaceDelims=1
  293. let NERDCreateDefaultMappings=0
  294. " comment hiding
  295. func! IsComment( lnum )
  296. return synIDattr(synID(a:lnum, match(getline(a:lnum),'\S')+1, 1),"name") =~? 'comment'
  297. endfun
  298. "set fdm=expr
  299. set fde=IsComment(v:lnum)?1:IsComment(prevnonblank(v:lnum))?1:IsComment(nextnonblank\(v:lnum))?1:0
  300. " light #073642 dark #002b36 grey #586e75
  301. highlight Folded gui=NONE guifg=#586e75 guibg=#002b36
  302. set foldtext='\ '
  303. let g:folded = 0
  304. function! ToggleComment()
  305. if (g:folded == 0)
  306. highlight Comment guifg=#002b36
  307. let g:folded=1
  308. else
  309. highlight Comment guifg=#586e75
  310. let g:folded=0
  311. endif
  312. endfunction
  313. let g:myfoldtext = 0
  314. function! ToggleFoldText()
  315. if (g:myfoldtext == 0)
  316. set foldtext='--'.v:folddashes.'\ '.getline(v:foldstart).'\ '
  317. let g:myfoldtext=1
  318. else
  319. set foldtext='\ '
  320. let g:myfoldtext=0
  321. endif
  322. endfunction
  323. """"""""""""""""""""""""""""""
  324. " vim macro to jump to devhelp topics.
  325. """"""""""""""""""""""""""""""
  326. function! DevHelpCurrentWord()
  327. let word = expand("<cword>")
  328. exe "!devhelp -s " . word . " &"
  329. endfunction
  330. function! ManCurrentWord()
  331. let word = expand("<cword>")
  332. exe "!man 3 " . word
  333. endfunction
  334. " vim:foldmethod=marker:foldlevel=0