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.

247 lines
6.6 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. " LaTeX support. It needs latexmk & zathura
  41. Plug 'lervag/vimtex'
  42. " deoplete
  43. Plug 'Shougo/deoplete.nvim'
  44. let g:deoplete#enable_at_startup = 1
  45. autocmd CompleteDone * pclose!
  46. " Plug 'zchee/deoplete-go', {'build': {'unix': 'make'}}
  47. " " neosnippet with deoplete
  48. " Plug 'Shougo/neosnippet.vim'
  49. " Plug 'Shougo/neosnippet-snippets'
  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. " automatically adjust shiftwidth and expand tab based on current file
  56. Plug 'tpope/vim-sleuth'
  57. " errors
  58. Plug 'Valloric/ListToggle'
  59. Plug 'autozimu/LanguageClient-neovim', {
  60. \ 'branch': 'next',
  61. \ 'do': 'bash install.sh',
  62. \ }
  63. Plug 'neoclide/coc.nvim', {'branch': 'release'}
  64. " after PlugInstall, install coc-rust-analyzer:
  65. " :CocInstall coc-rust-analyzer
  66. " focus mode
  67. Plug 'junegunn/goyo.vim'
  68. " vimwiki
  69. Plug 'vimwiki/vimwiki'
  70. " vim calendar
  71. Plug 'mattn/calendar-vim'
  72. " colors
  73. Plug 'tomasr/molokai'
  74. Plug 'srcery-colors/srcery-vim'
  75. Plug 'rakr/vim-one'
  76. Plug 'morhetz/gruvbox'
  77. call plug#end()
  78. " next 3 lines are needed for vimwiki
  79. set nocompatible
  80. filetype plugin on
  81. syntax on
  82. " vimwiki with markdown
  83. let g:vimwiki_list = [{'path': '~/vimwiki/',
  84. \ 'syntax': 'markdown', 'ext': '.md'}]
  85. " prevent vimwiki of setting conceallevel=2:
  86. let g:vimwiki_conceallevel=0
  87. let $NVIM_TUI_ENABLE_TRUE_COLOR=1
  88. set termguicolors
  89. if $COLORTERM == 'gnome-terminal'
  90. set term=gnome-256color
  91. else
  92. if $TERM == 'xterm'
  93. set term=xterm-256color
  94. endif
  95. endif
  96. set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\
  97. " NERDTree
  98. let NERDTreeShowHidden=1
  99. autocmd vimenter * NERDTree
  100. map <C-n> :NERDTreeToggle<CR>
  101. " NERDCommenter
  102. let g:NERDSpaceDelims = 1 " Add spaces after comment delimiters by default
  103. let g:NERDDefaultAlign = 'left' " Align line-wise comment delimiters flush left instead of following code indentation
  104. let g:NERDCommentEmptyLines = 1 " Allow commenting and inverting empty lines (useful when commenting a region)
  105. "" go config
  106. function! s:build_go_files()
  107. let l:file = expand('%')
  108. if l:file =~# '^\f\+\.go$'
  109. call go#cmd#Build(0)
  110. endif
  111. endfunction
  112. let g:go_list_type = "quickfix"
  113. let g:go_fmt_command = "goimports"
  114. let g:go_fmt_fail_silently = 1
  115. let g:go_highlight_types = 1
  116. let g:go_highlight_fields = 1
  117. let g:go_highlight_functions = 1
  118. let g:go_highlight_methods = 1
  119. let g:go_highlight_operators = 1
  120. let g:go_highlight_build_constraints = 1
  121. let g:go_highlight_structs = 1
  122. let g:go_highlight_generate_tags = 1
  123. let g:go_highlight_space_tab_error = 0
  124. let g:go_highlight_array_whitespace_error = 0
  125. let g:go_highlight_trailing_whitespace_error = 0
  126. let g:go_highlight_extra_types = 1
  127. " vim-airline
  128. "" let g:airline_theme = 'powerlineish'
  129. let g:airline_theme='one'
  130. " let g:airline#extensions#syntastic#enabled = 1
  131. let g:airline#extensions#branch#enabled = 1
  132. let g:airline#extensions#tabline#enabled = 1
  133. let g:airline#extensions#tabline#buffer_nr_show = 1
  134. let g:airline#extensions#tagbar#enabled = 1
  135. let g:airline_skip_empty_sections = 1
  136. " errors
  137. "" for go needs gopls installed (comes with vim-go pluggin)
  138. "" for rust with rust-analyzer needs https://rust-analyzer.github.io/manual.html#rust-analyzer-language-server-binary installed
  139. "" [old] for rust with rls needs https://github.com/rust-lang/rls installed
  140. let g:lt_location_list_toggle_map = '<leader>l'
  141. let g:lt_quickfix_list_toggle_map = '<leader>s'
  142. " \ 'rust': ['~/.cargo/bin/rustup', 'run', 'stable', 'rls'],
  143. let g:LanguageClient_serverCommands = {
  144. \ 'go': ['~/go/bin/gopls'],
  145. \ 'rust': ['rust-analyzer'],
  146. \ }
  147. let g:LanguageClient_diagnosticsList = "Quickfix"
  148. let g:LanguageClient_diagnosticsEnable = 1
  149. " language server key bindings
  150. nnoremap <F6> :call LanguageClient_contextMenu()<CR>
  151. " Specific mappings of LanguageClient each action separately
  152. nnoremap <silent> K :call LanguageClient#textDocument_hover()<CR>
  153. nnoremap <silent> KK :call LanguageClient#textDocument_hover()<CR>
  154. nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
  155. nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
  156. noremap <silent> <C-c> :cn<CR>
  157. " rainbowparentheses
  158. let g:rainbow_active = 1
  159. "" circom syntax
  160. au BufRead,BufNewFile *.circom set filetype=circom
  161. au BufRead,BufNewFile *.circuit set filetype=go-snark-circuit
  162. "" LaTeX vimtex config:
  163. " Important: This config needs latexmk & zathura to be installed.
  164. "
  165. " This is necessary for VimTeX to load properly. The "indent" is optional.
  166. " Note that most plugin managers will do this automatically.
  167. filetype plugin indent on
  168. " This enables Vim's and neovim's syntax-related features. Without this, some
  169. " VimTeX features will not work (see ":help vimtex-requirements" for more
  170. " info).
  171. syntax enable
  172. " Viewer options: One may configure the viewer either by specifying a built-in
  173. " viewer method:
  174. let g:vimtex_view_method = 'zathura'
  175. "" sage syntax
  176. augroup filetypedetect
  177. au! BufRead,BufNewFile *.sage,*.spyx,*.pyx setfiletype python
  178. augroup END
  179. " for file watching
  180. set backupcopy=yes
  181. " copy&paste from system clipboard
  182. vnoremap <leader>y "+y
  183. vnoremap <leader>p "+p
  184. " shortcut for theme change
  185. nnoremap <F9> :colorscheme gruvbox \| set background=dark \| highlight normal ctermbg=0 guibg=#000000 <CR>
  186. nnoremap <F10> :colorscheme gruvbox \| set background=light<CR>
  187. " colorscheme
  188. let g:gruvbox_contrast_dark = 'hard'
  189. let g:gruvbox_contrast_light = 'hard'
  190. let g:srcery_italic = 1
  191. set colorcolumn=100
  192. " set textwidth=80
  193. set background=dark
  194. " colorscheme molokai
  195. colorscheme gruvbox
  196. highlight normal ctermbg=0 guibg=#000000