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.

211 lines
5.5 KiB

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