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.

192 lines
4.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
  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
  88. let g:go_auto_sameids = 1
  89. "" go config
  90. function! s:build_go_files()
  91. let l:file = expand('%')
  92. if l:file =~# '^\f\+\.go$'
  93. call go#cmd#Build(0)
  94. endif
  95. endfunction
  96. let g:go_list_type = "quickfix"
  97. let g:go_fmt_command = "goimports"
  98. let g:go_fmt_fail_silently = 1
  99. let g:go_highlight_types = 1
  100. let g:go_highlight_fields = 1
  101. let g:go_highlight_functions = 1
  102. let g:go_highlight_methods = 1
  103. let g:go_highlight_operators = 1
  104. let g:go_highlight_build_constraints = 1
  105. let g:go_highlight_structs = 1
  106. let g:go_highlight_generate_tags = 1
  107. let g:go_highlight_space_tab_error = 0
  108. let g:go_highlight_array_whitespace_error = 0
  109. let g:go_highlight_trailing_whitespace_error = 0
  110. let g:go_highlight_extra_types = 1
  111. " vim-airline
  112. "" let g:airline_theme = 'powerlineish'
  113. let g:airline_theme='one'
  114. " let g:airline#extensions#syntastic#enabled = 1
  115. let g:airline#extensions#branch#enabled = 1
  116. let g:airline#extensions#tabline#enabled = 1
  117. let g:airline#extensions#tabline#buffer_nr_show = 1
  118. let g:airline#extensions#tagbar#enabled = 1
  119. let g:airline_skip_empty_sections = 1
  120. " errors
  121. "" for go needs gopls installed (comes with vim-go pluggin)
  122. "" for rust needs https://github.com/rust-lang/rls installed
  123. let g:lt_location_list_toggle_map = '<leader>l'
  124. let g:lt_quickfix_list_toggle_map = '<leader>s'
  125. let g:LanguageClient_serverCommands = {
  126. \ 'go': ['~/go/bin/gopls'],
  127. \ 'rust': ['~/.cargo/bin/rustup', 'run', 'stable', 'rls'],
  128. \ }
  129. let g:LanguageClient_diagnosticsList = "Quickfix"
  130. let g:LanguageClient_diagnosticsEnable = 1
  131. " rainbowparentheses
  132. let g:rainbow_active = 1
  133. "" circom syntax
  134. au BufRead,BufNewFile *.circom set filetype=circom
  135. au BufRead,BufNewFile *.circuit set filetype=go-snark-circuit
  136. " for file watching
  137. set backupcopy=yes
  138. " shortcut for theme change
  139. nnoremap <F9> :colorscheme gruvbox \| set background=dark \| highlight normal ctermbg=0 guibg=#000000 <CR>
  140. nnoremap <F10> :colorscheme gruvbox \| set background=light<CR>
  141. " colorscheme
  142. let g:gruvbox_contrast_dark = 'hard'
  143. let g:gruvbox_contrast_light = 'hard'
  144. let g:srcery_italic = 1
  145. set background=dark
  146. " colorscheme molokai
  147. colorscheme gruvbox
  148. highlight normal ctermbg=0 guibg=#000000