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.

200 lines
5.1 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 ~/vimconfigbase.vim
  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. " git
  22. Plug 'tpope/vim-fugitive'
  23. " go
  24. Plug 'fatih/vim-go' " Amazing combination of features.
  25. Plug 'godoctor/godoctor.vim' " Some refactoring tools
  26. " rust
  27. Plug 'rust-lang/rust.vim'
  28. " set hidden
  29. let g:rustfmt_fail_silently = 0
  30. let g:rustfmt_autosave = 1
  31. " javascript
  32. Plug 'jelera/vim-javascript-syntax'
  33. " python
  34. Plug 'davidhalter/jedi-vim'
  35. Plug 'raimon49/requirements.txt.vim', {'for': 'requirements'}
  36. " solidity
  37. Plug 'tomlion/vim-solidity'
  38. " circom
  39. Plug 'iden3/vim-circom-syntax'
  40. "
  41. " " deoplete
  42. " Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
  43. " Plug 'zchee/deoplete-go', {'build': {'unix': 'make'}}
  44. " " neosnippet with deoplete
  45. " Plug 'Shougo/neosnippet.vim'
  46. " Plug 'Shougo/neosnippet-snippets'
  47. " automatically adjust shiftwidth and expand tab based on current file
  48. Plug 'tpope/vim-sleuth'
  49. " let g:deoplete#enable_at_startup = 1
  50. " Plugin deoplete neosnippet key-mappings.
  51. " Note: It must be "imap" and "smap". It uses <Plug> mappings.
  52. imap <C-k> <Plug>(neosnippet_expand_or_jump)
  53. smap <C-k> <Plug>(neosnippet_expand_or_jump)
  54. xmap <C-k> <Plug>(neosnippet_expand_target)
  55. " errors
  56. Plug 'Valloric/ListToggle'
  57. Plug 'autozimu/LanguageClient-neovim', {
  58. \ 'branch': 'next',
  59. \ 'do': 'bash install.sh',
  60. \ }
  61. " focus mode
  62. Plug 'junegunn/goyo.vim'
  63. " colors
  64. Plug 'tomasr/molokai'
  65. Plug 'srcery-colors/srcery-vim'
  66. Plug 'rakr/vim-one'
  67. Plug 'morhetz/gruvbox'
  68. call plug#end()
  69. let $NVIM_TUI_ENABLE_TRUE_COLOR=1
  70. set termguicolors
  71. if $COLORTERM == 'gnome-terminal'
  72. set term=gnome-256color
  73. else
  74. if $TERM == 'xterm'
  75. set term=xterm-256color
  76. endif
  77. endif
  78. set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\
  79. " NERDTree
  80. let NERDTreeShowHidden=1
  81. autocmd vimenter * NERDTree
  82. map <C-n> :NERDTreeToggle<CR>
  83. " NERDCommenter
  84. let g:NERDSpaceDelims = 1 " Add spaces after comment delimiters by default
  85. let g:NERDDefaultAlign = 'left' " Align line-wise comment delimiters flush left instead of following code indentation
  86. let g:NERDCommentEmptyLines = 1 " Allow commenting and inverting empty lines (useful when commenting a region)
  87. "" go config
  88. function! s:build_go_files()
  89. let l:file = expand('%')
  90. if l:file =~# '^\f\+\.go$'
  91. call go#cmd#Build(0)
  92. endif
  93. endfunction
  94. let g:go_list_type = "quickfix"
  95. let g:go_fmt_command = "goimports"
  96. let g:go_fmt_fail_silently = 1
  97. let g:go_highlight_types = 1
  98. let g:go_highlight_fields = 1
  99. let g:go_highlight_functions = 1
  100. let g:go_highlight_methods = 1
  101. let g:go_highlight_operators = 1
  102. let g:go_highlight_build_constraints = 1
  103. let g:go_highlight_structs = 1
  104. let g:go_highlight_generate_tags = 1
  105. let g:go_highlight_space_tab_error = 0
  106. let g:go_highlight_array_whitespace_error = 0
  107. let g:go_highlight_trailing_whitespace_error = 0
  108. let g:go_highlight_extra_types = 1
  109. " vim-airline
  110. "" let g:airline_theme = 'powerlineish'
  111. let g:airline_theme='one'
  112. " let g:airline#extensions#syntastic#enabled = 1
  113. let g:airline#extensions#branch#enabled = 1
  114. let g:airline#extensions#tabline#enabled = 1
  115. let g:airline#extensions#tabline#buffer_nr_show = 1
  116. let g:airline#extensions#tagbar#enabled = 1
  117. let g:airline_skip_empty_sections = 1
  118. " errors
  119. "" for go needs gopls installed (comes with vim-go pluggin)
  120. "" for rust needs https://github.com/rust-lang/rls installed
  121. let g:lt_location_list_toggle_map = '<leader>l'
  122. let g:lt_quickfix_list_toggle_map = '<leader>s'
  123. let g:LanguageClient_serverCommands = {
  124. \ 'go': ['~/go/bin/gopls'],
  125. \ 'rust': ['~/.cargo/bin/rustup', 'run', 'stable', 'rls'],
  126. \ }
  127. let g:LanguageClient_diagnosticsList = "Quickfix"
  128. let g:LanguageClient_diagnosticsEnable = 1
  129. " language server key bindings
  130. nnoremap <F6> :call LanguageClient_contextMenu()<CR>
  131. " Specific mappings of LanguageClient each action separately
  132. nnoremap <silent> K :call LanguageClient#textDocument_hover()<CR>
  133. nnoremap <silent> KK :call LanguageClient#textDocument_hover()<CR>
  134. nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
  135. nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
  136. " rainbowparentheses
  137. let g:rainbow_active = 1
  138. "" circom syntax
  139. au BufRead,BufNewFile *.circom set filetype=circom
  140. au BufRead,BufNewFile *.circuit set filetype=go-snark-circuit
  141. " for file watching
  142. set backupcopy=yes
  143. " shortcut for theme change
  144. nnoremap <F9> :colorscheme gruvbox \| set background=dark \| highlight normal ctermbg=0 guibg=#000000 <CR>
  145. nnoremap <F10> :colorscheme gruvbox \| set background=light<CR>
  146. " colorscheme
  147. let g:gruvbox_contrast_dark = 'hard'
  148. let g:gruvbox_contrast_light = 'hard'
  149. let g:srcery_italic = 1
  150. set colorcolumn=100
  151. set textwidth=80
  152. set background=dark
  153. " colorscheme molokai
  154. colorscheme gruvbox
  155. highlight normal ctermbg=0 guibg=#000000