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.

225 lines
5.7 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
  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. " vimwiki
  64. Plug 'vimwiki/vimwiki'
  65. " vim calendar
  66. Plug 'mattn/calendar-vim'
  67. " colors
  68. Plug 'tomasr/molokai'
  69. Plug 'srcery-colors/srcery-vim'
  70. Plug 'rakr/vim-one'
  71. Plug 'morhetz/gruvbox'
  72. call plug#end()
  73. " next 3 lines are needed for vimwiki
  74. set nocompatible
  75. filetype plugin on
  76. syntax on
  77. " vimwiki with markdown
  78. let g:vimwiki_list = [{'path': '~/vimwiki/',
  79. \ 'syntax': 'markdown', 'ext': '.md'}]
  80. " prevent vimwiki of setting conceallevel=2:
  81. let g:vimwiki_conceallevel=0
  82. let $NVIM_TUI_ENABLE_TRUE_COLOR=1
  83. set termguicolors
  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 config
  101. function! s:build_go_files()
  102. let l:file = expand('%')
  103. if l:file =~# '^\f\+\.go$'
  104. call go#cmd#Build(0)
  105. endif
  106. endfunction
  107. let g:go_list_type = "quickfix"
  108. let g:go_fmt_command = "goimports"
  109. let g:go_fmt_fail_silently = 1
  110. let g:go_highlight_types = 1
  111. let g:go_highlight_fields = 1
  112. let g:go_highlight_functions = 1
  113. let g:go_highlight_methods = 1
  114. let g:go_highlight_operators = 1
  115. let g:go_highlight_build_constraints = 1
  116. let g:go_highlight_structs = 1
  117. let g:go_highlight_generate_tags = 1
  118. let g:go_highlight_space_tab_error = 0
  119. let g:go_highlight_array_whitespace_error = 0
  120. let g:go_highlight_trailing_whitespace_error = 0
  121. let g:go_highlight_extra_types = 1
  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. " errors
  132. "" for go needs gopls installed (comes with vim-go pluggin)
  133. "" for rust needs https://github.com/rust-lang/rls installed
  134. let g:lt_location_list_toggle_map = '<leader>l'
  135. let g:lt_quickfix_list_toggle_map = '<leader>s'
  136. let g:LanguageClient_serverCommands = {
  137. \ 'go': ['~/go/bin/gopls'],
  138. \ 'rust': ['~/.cargo/bin/rustup', 'run', 'stable', 'rls'],
  139. \ }
  140. let g:LanguageClient_diagnosticsList = "Quickfix"
  141. let g:LanguageClient_diagnosticsEnable = 1
  142. " language server key bindings
  143. nnoremap <F6> :call LanguageClient_contextMenu()<CR>
  144. " Specific mappings of LanguageClient each action separately
  145. nnoremap <silent> K :call LanguageClient#textDocument_hover()<CR>
  146. nnoremap <silent> KK :call LanguageClient#textDocument_hover()<CR>
  147. nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
  148. nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
  149. noremap <silent> <C-c> :cn<CR>
  150. " rainbowparentheses
  151. let g:rainbow_active = 1
  152. "" circom syntax
  153. au BufRead,BufNewFile *.circom set filetype=circom
  154. au BufRead,BufNewFile *.circuit set filetype=go-snark-circuit
  155. "" sage syntax
  156. augroup filetypedetect
  157. au! BufRead,BufNewFile *.sage,*.spyx,*.pyx setfiletype python
  158. augroup END
  159. " for file watching
  160. set backupcopy=yes
  161. " copy&paste from system clipboard
  162. vnoremap <leader>y "+y
  163. vnoremap <leader>p "+p
  164. " shortcut for theme change
  165. nnoremap <F9> :colorscheme gruvbox \| set background=dark \| highlight normal ctermbg=0 guibg=#000000 <CR>
  166. nnoremap <F10> :colorscheme gruvbox \| set background=light<CR>
  167. " colorscheme
  168. let g:gruvbox_contrast_dark = 'hard'
  169. let g:gruvbox_contrast_light = 'hard'
  170. let g:srcery_italic = 1
  171. set colorcolumn=100
  172. " set textwidth=80
  173. set background=dark
  174. " colorscheme molokai
  175. colorscheme gruvbox
  176. highlight normal ctermbg=0 guibg=#000000