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.

194 lines
5.2 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
  1. source ~/.vimrc
  2. call plug#begin(expand('~/.config/nvim/plugged'))
  3. nnoremap <Space> <nop>
  4. let mapleader = "\<Space>"
  5. let g:mapleader = "\<Space>"
  6. let maplocalleader = "\<Space>"
  7. " nerdtree
  8. Plug 'scrooloose/nerdtree'
  9. Plug 'jistr/vim-nerdtree-tabs'
  10. Plug 'scrooloose/nerdcommenter'
  11. " vim-airline
  12. Plug 'vim-airline/vim-airline'
  13. Plug 'vim-airline/vim-airline-themes'
  14. " vim-ripgrep
  15. Plug 'jremmen/vim-ripgrep'
  16. Plug 'airblade/vim-gitgutter'
  17. Plug 'Raimondi/delimitMate'
  18. Plug 'majutsushi/tagbar'
  19. " rainbow parentheses
  20. Plug 'luochen1990/rainbow'
  21. " go
  22. Plug 'fatih/vim-go' " Amazing combination of features.
  23. Plug 'godoctor/godoctor.vim' " Some refactoring tools
  24. " rust
  25. Plug 'rust-lang/rust.vim'
  26. " set hidden
  27. let g:rustfmt_fail_silently = 0
  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. " solidity
  35. Plug 'tomlion/vim-solidity'
  36. " circom
  37. Plug 'iden3/vim-circom-syntax'
  38. " deoplete
  39. Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
  40. Plug 'zchee/deoplete-go', {'build': {'unix': 'make'}}
  41. " neosnippet with deoplete
  42. Plug 'Shougo/neosnippet.vim'
  43. Plug 'Shougo/neosnippet-snippets'
  44. " automatically adjust shiftwidth and expand tab based on current file
  45. Plug 'tpope/vim-sleuth'
  46. let g:deoplete#enable_at_startup = 1
  47. " Plugin deoplete neosnippet key-mappings.
  48. " Note: It must be "imap" and "smap". It uses <Plug> mappings.
  49. imap <C-k> <Plug>(neosnippet_expand_or_jump)
  50. smap <C-k> <Plug>(neosnippet_expand_or_jump)
  51. xmap <C-k> <Plug>(neosnippet_expand_target)
  52. " errors
  53. Plug 'Valloric/ListToggle'
  54. Plug 'autozimu/LanguageClient-neovim', {
  55. \ 'branch': 'next',
  56. \ 'do': 'bash install.sh',
  57. \ }
  58. " focus mode
  59. Plug 'junegunn/goyo.vim'
  60. " colors
  61. Plug 'tomasr/molokai'
  62. Plug 'srcery-colors/srcery-vim'
  63. Plug 'rakr/vim-one'
  64. Plug 'morhetz/gruvbox'
  65. Plug 'NLKNguyen/papercolor-theme'
  66. let g:srcery_italic = 1
  67. call plug#end()
  68. "Credit joshdick
  69. "Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
  70. "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
  71. "(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
  72. if (empty($TMUX))
  73. if (has("nvim"))
  74. "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
  75. let $NVIM_TUI_ENABLE_TRUE_COLOR=1
  76. endif
  77. "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
  78. "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
  79. " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
  80. if (has("termguicolors"))
  81. set termguicolors
  82. endif
  83. endif
  84. if $COLORTERM == 'gnome-terminal'
  85. set term=gnome-256color
  86. else
  87. if $TERM == 'xterm'
  88. set term=xterm-256color
  89. endif
  90. endif
  91. set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\
  92. " NERDTree
  93. let NERDTreeShowHidden=1
  94. autocmd vimenter * NERDTree
  95. map <C-n> :NERDTreeToggle<CR>
  96. " NERDCommenter
  97. let g:NERDSpaceDelims = 1 " Add spaces after comment delimiters by default
  98. let g:NERDDefaultAlign = 'left' " Align line-wise comment delimiters flush left instead of following code indentation
  99. let g:NERDCommentEmptyLines = 1 " Allow commenting and inverting empty lines (useful when commenting a region)
  100. " go
  101. let g:go_auto_sameids = 1
  102. "" go config
  103. function! s:build_go_files()
  104. let l:file = expand('%')
  105. if l:file =~# '^\f\+\.go$'
  106. call go#cmd#Build(0)
  107. endif
  108. endfunction
  109. let g:go_list_type = "quickfix"
  110. let g:go_fmt_command = "goimports"
  111. let g:go_fmt_fail_silently = 1
  112. let g:go_highlight_types = 1
  113. let g:go_highlight_fields = 1
  114. let g:go_highlight_functions = 1
  115. let g:go_highlight_methods = 1
  116. let g:go_highlight_operators = 1
  117. let g:go_highlight_build_constraints = 1
  118. let g:go_highlight_structs = 1
  119. let g:go_highlight_generate_tags = 1
  120. let g:go_highlight_space_tab_error = 0
  121. let g:go_highlight_array_whitespace_error = 0
  122. let g:go_highlight_trailing_whitespace_error = 0
  123. let g:go_highlight_extra_types = 1
  124. " vim-airline
  125. "" let g:airline_theme = 'powerlineish'
  126. let g:airline_theme='one'
  127. " let g:airline#extensions#syntastic#enabled = 1
  128. let g:airline#extensions#branch#enabled = 1
  129. let g:airline#extensions#tabline#enabled = 1
  130. let g:airline#extensions#tabline#buffer_nr_show = 1
  131. let g:airline#extensions#tagbar#enabled = 1
  132. let g:airline_skip_empty_sections = 1
  133. " errors
  134. "" for go needs gopls installed (comes with vim-go pluggin)
  135. "" for rust needs https://github.com/rust-lang/rls installed
  136. let g:lt_location_list_toggle_map = '<leader>l'
  137. let g:lt_quickfix_list_toggle_map = '<leader>s'
  138. let g:LanguageClient_serverCommands = {
  139. \ 'go': ['~/go/bin/gopls'],
  140. \ 'rust': ['~/.cargo/bin/rustup', 'run', 'stable', 'rls'],
  141. \ }
  142. let g:LanguageClient_diagnosticsList = "Quickfix"
  143. let g:LanguageClient_diagnosticsEnable = 1
  144. " rainbowparentheses
  145. let g:rainbow_active = 1
  146. "" circom syntax
  147. au BufRead,BufNewFile *.circom set filetype=circom
  148. au BufRead,BufNewFile *.circuit set filetype=go-snark-circuit
  149. " for file watching
  150. set backupcopy=yes
  151. " shortcut for theme change
  152. nnoremap <F9> :colorscheme molokai \| set background=dark<CR>
  153. nnoremap <F10> :colorscheme PaperColor \| set background=light<CR>
  154. colorscheme molokai