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.

208 lines
5.5 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. call plug#begin(expand('~/.config/nvim/plugged'))
  2. " NERDTree
  3. Plug 'scrooloose/nerdtree'
  4. Plug 'jistr/vim-nerdtree-tabs'
  5. Plug 'scrooloose/nerdcommenter'
  6. " vim-airline
  7. Plug 'vim-airline/vim-airline'
  8. Plug 'vim-airline/vim-airline-themes'
  9. " syntastic
  10. Plug 'scrooloose/syntastic'
  11. Plug 'airblade/vim-gitgutter'
  12. Plug 'Raimondi/delimitMate'
  13. Plug 'majutsushi/tagbar'
  14. " rainbow parentheses
  15. Plug 'luochen1990/rainbow'
  16. " go
  17. Plug 'fatih/vim-go' " Amazing combination of features.
  18. Plug 'godoctor/godoctor.vim' " Some refactoring tools
  19. " rust
  20. "" will need to install https://github.com/racer-rust/racer
  21. Plug 'racer-rust/vim-racer'
  22. Plug 'rust-lang/rust.vim'
  23. set hidden
  24. let g:racer_cmd = "/home/user/.cargo/bin/racer"
  25. let g:racer_experimental_completer = 1
  26. let g:rustfmt_autosave = 1
  27. " javascript
  28. Plug 'jelera/vim-javascript-syntax'
  29. " python
  30. Plug 'davidhalter/jedi-vim'
  31. Plug 'raimon49/requirements.txt.vim', {'for': 'requirements'}
  32. " deoplete
  33. Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
  34. Plug 'zchee/deoplete-go', {'build': {'unix': 'make'}}
  35. " neosnippet with deoplete
  36. Plug 'Shougo/neosnippet.vim'
  37. Plug 'Shougo/neosnippet-snippets'
  38. " automatically adjust shiftwidth and expand tab based on current file
  39. Plug 'tpope/vim-sleuth'
  40. let g:deoplete#enable_at_startup = 1
  41. " Plugin deoplete neosnippet key-mappings.
  42. " Note: It must be "imap" and "smap". It uses <Plug> mappings.
  43. imap <C-k> <Plug>(neosnippet_expand_or_jump)
  44. smap <C-k> <Plug>(neosnippet_expand_or_jump)
  45. xmap <C-k> <Plug>(neosnippet_expand_target)
  46. " colors
  47. Plug 'tomasr/molokai'
  48. Plug 'srcery-colors/srcery-vim'
  49. Plug 'rakr/vim-one'
  50. Plug 'morhetz/gruvbox'
  51. Plug 'toupeira/vim-desertink'
  52. Plug 'maksimr/Lucius2'
  53. let g:srcery_italic = 1
  54. call plug#end()
  55. " visual
  56. syntax on
  57. set ruler
  58. set number
  59. set title
  60. set titlestring=nvim-%F
  61. set t_Co=256
  62. set cursorline
  63. set background=dark " for the dark version
  64. "Credit joshdick
  65. "Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
  66. "If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
  67. "(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
  68. if (empty($TMUX))
  69. if (has("nvim"))
  70. "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
  71. let $NVIM_TUI_ENABLE_TRUE_COLOR=1
  72. endif
  73. "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
  74. "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
  75. " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
  76. if (has("termguicolors"))
  77. set termguicolors
  78. endif
  79. endif
  80. if $COLORTERM == 'gnome-terminal'
  81. set term=gnome-256color
  82. else
  83. if $TERM == 'xterm'
  84. set term=xterm-256color
  85. endif
  86. endif
  87. set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\
  88. " go
  89. let g:go_auto_sameids = 1
  90. "" go config
  91. function! s:build_go_files()
  92. let l:file = expand('%')
  93. if l:file =~# '^\f\+\.go$'
  94. call go#cmd#Build(0)
  95. endif
  96. endfunction
  97. let g:go_list_type = "quickfix"
  98. let g:go_fmt_command = "goimports"
  99. let g:go_fmt_fail_silently = 1
  100. let g:go_highlight_types = 1
  101. let g:go_highlight_fields = 1
  102. let g:go_highlight_functions = 1
  103. let g:go_highlight_methods = 1
  104. let g:go_highlight_operators = 1
  105. let g:go_highlight_build_constraints = 1
  106. let g:go_highlight_structs = 1
  107. let g:go_highlight_generate_tags = 1
  108. let g:go_highlight_space_tab_error = 0
  109. let g:go_highlight_array_whitespace_error = 0
  110. let g:go_highlight_trailing_whitespace_error = 0
  111. let g:go_highlight_extra_types = 1
  112. " NERDTree
  113. let NERDTreeShowHidden=1
  114. autocmd vimenter * NERDTree
  115. map <C-n> :NERDTreeToggle<CR>
  116. " NERDCommenter
  117. let g:NERDSpaceDelims = 1 " Add spaces after comment delimiters by default
  118. let g:NERDDefaultAlign = 'left' " Align line-wise comment delimiters flush left instead of following code indentation
  119. let g:NERDCommentEmptyLines = 1 " Allow commenting and inverting empty lines (useful when commenting a region)
  120. " vim-airline
  121. "" let g:airline_theme = 'powerlineish'
  122. let g:airline_theme='one'
  123. let g:airline#extensions#syntastic#enabled = 1
  124. let g:airline#extensions#branch#enabled = 1
  125. let g:airline#extensions#tabline#enabled = 1
  126. let g:airline#extensions#tabline#buffer_nr_show = 1
  127. let g:airline#extensions#tagbar#enabled = 1
  128. let g:airline_skip_empty_sections = 1
  129. " syntastic
  130. let g:syntastic_always_populate_loc_list=1
  131. let g:syntastic_error_symbol='✗'
  132. let g:syntastic_warning_symbol='⚠'
  133. let g:syntastic_style_error_symbol = '✗'
  134. let g:syntastic_style_warning_symbol = '⚠'
  135. let g:syntastic_auto_loc_list=1
  136. let g:syntastic_aggregate_errors = 1
  137. let g:syntastic_go_checkers = ['golint', 'govet']
  138. let g:syntastic_python_checkers = []
  139. let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
  140. " rainbowparentheses
  141. let g:rainbow_active = 1
  142. " abbreviations
  143. cnoreabbrev W! w!
  144. cnoreabbrev Q! q!
  145. cnoreabbrev Qall! qall!
  146. cnoreabbrev Wq wq
  147. cnoreabbrev Wa wa
  148. cnoreabbrev wQ wq
  149. cnoreabbrev WQ wq
  150. cnoreabbrev W w
  151. cnoreabbrev Q q
  152. cnoreabbrev Qall qall
  153. "" Switching windows
  154. noremap <C-j> <C-w>j
  155. noremap <C-k> <C-w>k
  156. noremap <C-l> <C-w>l
  157. noremap <C-h> <C-w>h
  158. "" esc mapping
  159. inoremap jk <ESC>
  160. tnoremap jk <C-\><C-n>
  161. " scroll
  162. set scrolloff=5 " keep at least 5 lines above/below
  163. set sidescrolloff=5 " keep at least 5 lines left/right
  164. "" circom syntax
  165. au BufRead,BufNewFile *.circom set filetype=circom
  166. au BufRead,BufNewFile *.circuit set filetype=go-snark-circuit
  167. " for file watching
  168. set backupcopy=yes
  169. colorscheme molokai