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.

242 lines
6.3 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
  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. "
  43. " " deoplete
  44. " Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
  45. " Plug 'zchee/deoplete-go', {'build': {'unix': 'make'}}
  46. " " neosnippet with deoplete
  47. " Plug 'Shougo/neosnippet.vim'
  48. " Plug 'Shougo/neosnippet-snippets'
  49. " automatically adjust shiftwidth and expand tab based on current file
  50. Plug 'tpope/vim-sleuth'
  51. " let g:deoplete#enable_at_startup = 1
  52. " Plugin deoplete neosnippet key-mappings.
  53. " Note: It must be "imap" and "smap". It uses <Plug> mappings.
  54. imap <C-k> <Plug>(neosnippet_expand_or_jump)
  55. smap <C-k> <Plug>(neosnippet_expand_or_jump)
  56. xmap <C-k> <Plug>(neosnippet_expand_target)
  57. " errors
  58. Plug 'Valloric/ListToggle'
  59. Plug 'autozimu/LanguageClient-neovim', {
  60. \ 'branch': 'next',
  61. \ 'do': 'bash install.sh',
  62. \ }
  63. " focus mode
  64. Plug 'junegunn/goyo.vim'
  65. " vimwiki
  66. Plug 'vimwiki/vimwiki'
  67. " vim calendar
  68. Plug 'mattn/calendar-vim'
  69. " colors
  70. Plug 'tomasr/molokai'
  71. Plug 'srcery-colors/srcery-vim'
  72. Plug 'rakr/vim-one'
  73. Plug 'morhetz/gruvbox'
  74. call plug#end()
  75. " next 3 lines are needed for vimwiki
  76. set nocompatible
  77. filetype plugin on
  78. syntax on
  79. " vimwiki with markdown
  80. let g:vimwiki_list = [{'path': '~/vimwiki/',
  81. \ 'syntax': 'markdown', 'ext': '.md'}]
  82. " prevent vimwiki of setting conceallevel=2:
  83. let g:vimwiki_conceallevel=0
  84. let $NVIM_TUI_ENABLE_TRUE_COLOR=1
  85. set termguicolors
  86. if $COLORTERM == 'gnome-terminal'
  87. set term=gnome-256color
  88. else
  89. if $TERM == 'xterm'
  90. set term=xterm-256color
  91. endif
  92. endif
  93. set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\
  94. " NERDTree
  95. let NERDTreeShowHidden=1
  96. autocmd vimenter * NERDTree
  97. map <C-n> :NERDTreeToggle<CR>
  98. " NERDCommenter
  99. let g:NERDSpaceDelims = 1 " Add spaces after comment delimiters by default
  100. let g:NERDDefaultAlign = 'left' " Align line-wise comment delimiters flush left instead of following code indentation
  101. let g:NERDCommentEmptyLines = 1 " Allow commenting and inverting empty lines (useful when commenting a region)
  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. " 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. " rainbowparentheses
  153. let g:rainbow_active = 1
  154. "" circom syntax
  155. au BufRead,BufNewFile *.circom set filetype=circom
  156. au BufRead,BufNewFile *.circuit set filetype=go-snark-circuit
  157. "" LaTeX vimtex config:
  158. " Important: This config needs latexmk & zathura to be installed.
  159. "
  160. " This is necessary for VimTeX to load properly. The "indent" is optional.
  161. " Note that most plugin managers will do this automatically.
  162. filetype plugin indent on
  163. " This enables Vim's and neovim's syntax-related features. Without this, some
  164. " VimTeX features will not work (see ":help vimtex-requirements" for more
  165. " info).
  166. syntax enable
  167. " Viewer options: One may configure the viewer either by specifying a built-in
  168. " viewer method:
  169. let g:vimtex_view_method = 'zathura'
  170. "" sage syntax
  171. augroup filetypedetect
  172. au! BufRead,BufNewFile *.sage,*.spyx,*.pyx setfiletype python
  173. augroup END
  174. " for file watching
  175. set backupcopy=yes
  176. " copy&paste from system clipboard
  177. vnoremap <leader>y "+y
  178. vnoremap <leader>p "+p
  179. " shortcut for theme change
  180. nnoremap <F9> :colorscheme gruvbox \| set background=dark \| highlight normal ctermbg=0 guibg=#000000 <CR>
  181. nnoremap <F10> :colorscheme gruvbox \| set background=light<CR>
  182. " colorscheme
  183. let g:gruvbox_contrast_dark = 'hard'
  184. let g:gruvbox_contrast_light = 'hard'
  185. let g:srcery_italic = 1
  186. set colorcolumn=100
  187. " set textwidth=80
  188. set background=dark
  189. " colorscheme molokai
  190. colorscheme gruvbox
  191. highlight normal ctermbg=0 guibg=#000000