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.

253 lines
6.9 KiB

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