Browse Source

vim config update

master
Ivan Polyakov 2 weeks ago
parent
commit
e1d1b8ea4a
  1. 1
      .config/vim/.gitignore
  2. 2863
      .config/vim/autoload/plug.vim
  3. 2859
      .config/vim/autoload/plug.vim.old
  4. 5
      .config/vim/debug.vim
  5. 22
      .config/vim/general.vim
  6. 3
      .config/vim/init.vim
  7. 10
      .config/vim/keybindings.vim
  8. 63
      .config/vim/lsp.vim
  9. 5
      .config/vim/netrw.vim
  10. 11
      .config/vim/plugins.vim
  11. 42
      .gitmodules
  12. 1
      .vim/pack/editor/opt/rainbow
  13. 1
      .vim/pack/editor/start/editorconfig-vim
  14. 1
      .vim/pack/editor/start/papercolor-theme
  15. 1
      .vim/pack/editor/start/ultisnips
  16. 1
      .vim/pack/editor/start/vim-gitgutter
  17. 1
      .vim/pack/editor/start/vim-healthcheck
  18. 1
      .vim/pack/editor/start/vim-snippets
  19. 1
      .vim/pack/files/opt/SchemaStore.vim
  20. 1
      .vim/pack/files/opt/vim-cmake
  21. 1
      .vim/pack/files/start/vim-gnupg
  22. 1
      .vim/pack/files/start/vim-markdown
  23. 1
      .vim/pack/lsp/start/lsp
  24. 1
      .vim/pack/web/opt/vim-prettier
  25. 1
      .vim/pack/web/opt/vim-pug
  26. 24
      .vim/scheme.vimrc
  27. BIN
      .vim/spell/ru.utf-8.spl
  28. 45
      .vim/web.vimrc
  29. 2
      README.md

1
.config/vim/.gitignore vendored

@ -1,2 +1 @@ @@ -1,2 +1 @@
.netrwhist
plugged/

2863
.config/vim/autoload/plug.vim

File diff suppressed because it is too large Load Diff

2859
.config/vim/autoload/plug.vim.old

File diff suppressed because it is too large Load Diff

5
.config/vim/debug.vim

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
let g:lsp_log_verbose = 1
let g:lsp_log_file = expand('~/.cache/vim/vim-lsp.log')
" for asyncomplete.vim log
let g:asyncomplete_log_file = expand('~/.cache/vim/asyncomplete.log')

22
.config/vim/general.vim

@ -6,17 +6,28 @@ set expandtab " use spaces @@ -6,17 +6,28 @@ set expandtab " use spaces
set tabstop=4
set shiftwidth=4
set scrolloff=2
set updatetime=1000
set conceallevel=1
autocmd FileType scheme setlocal expandtab shiftwidth=2 softtabstop=2
if executable("clang-format")
autocmd FileType c,h,cpp,hpp,cxx,hxx setlocal equalprg=clang-format
endif
" Search
set ignorecase
" Editor UI
set number relativenumber
set ruler
set cc=80
colorscheme zaibatsu
colorscheme PaperColor
" netrw
let g:netrw_altv=1 " split window to the right
let g:netrw_liststyle=3 " tree style listing
let g:netrw_list_hide=netrw_gitignore#Hide()
" Spell
"set spell
"setlocal spelllang=en_us,ru_ru
" File search
set path+=** " Provides tab-completion for all file-related tasks
@ -30,3 +41,6 @@ command! Mktags !ctags -R @@ -30,3 +41,6 @@ command! Mktags !ctags -R
\ --exclude=.svn
\ $(test -r .ctagsignore && echo "--exclude=@.ctagsignore")
\ .
let g:vim_markdown_folding_disabled = 1
let g:vim_markdown_math = 1

3
.config/vim/init.vim

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
source ~/.config/vim/general.vim
source ~/.config/vim/paths.vim
source ~/.config/vim/plugins.vim
source ~/.config/vim/netrw.vim
source ~/.config/vim/keybindings.vim
source ~/.config/vim/lsp.vim

10
.config/vim/keybindings.vim

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
" I think, custom keybindings must be start with <leader> key
" to avoid overwriting default bindings. First key after <leader>
" must be a first letter of the called entity.
" For example, keybinding that calls *snippets* should starts with
" <leader> + s (Snippets)"
" Snippets
let g:UltiSnipsExpandTrigger="<leader>s"
let g:UltiSnipsJumpForwardTrigger="<leader>sn"
let g:UltiSnipsJumpBackwardTrigger="<leader>sb"

63
.config/vim/lsp.vim

@ -1,46 +1,23 @@ @@ -1,46 +1,23 @@
" Register LSP servers
vim9script
"" Register clangd C and C++ lanuage server.
if executable('clangd')
augroup lsp_clangd
autocmd!
autocmd User lsp_setup call lsp#register_server({
\ 'name': 'clangd',
\ 'cmd': {server_info->['clangd']},
\ 'whitelist': ['c', 'cpp', 'cxx', 'objc', 'objcpp'],
\ })
autocmd FileType c setlocal omnifunc=lsp#complete
autocmd FileType cpp setlocal omnifunc=lsp#complete
autocmd FileType objc setlocal omnifunc=lsp#complete
autocmd FileType objcpp setlocal omnifunc=lsp#complete
augroup end
endif
function! s:on_lsp_buffer_enabled() abort
setlocal omnifunc=lsp#complete
setlocal signcolumn=yes
if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
nmap <buffer> gd <plug>(lsp-definition)
nmap <buffer> gs <plug>(lsp-document-symbol-search)
nmap <buffer> gS <plug>(lsp-workspace-symbol-search)
nmap <buffer> gr <plug>(lsp-references)
nmap <buffer> gi <plug>(lsp-implementation)
nmap <buffer> gt <plug>(lsp-type-definition)
nmap <buffer> <leader>rn <plug>(lsp-rename)
nmap <buffer> [g <plug>(lsp-previous-diagnostic)
nmap <buffer> ]g <plug>(lsp-next-diagnostic)
nmap <buffer> K <plug>(lsp-hover)
nnoremap <buffer> <expr><c-f> lsp#scroll(+4)
nnoremap <buffer> <expr><c-d> lsp#scroll(-4)
let g:lsp_format_sync_timeout = 1000
autocmd! BufWritePre *.rs,*.go call execute('LspDocumentFormatSync')
packadd lsp
" refer to doc to add more commands
endfunction
# C and C++
if executable("clangd")
g:LspAddServer([{
name: 'clangd',
filetype: ['c', 'cpp'],
path: 'clangd',
args: ['--background-index', '--clang-tidy'],
}])
endif
augroup lsp_install
au!
" call s:on_lsp_buffer_enabled only for languages that has the server registered.
autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
augroup END
# Javascript/Typescript
if executable("typescript-language-server")
g:LspAddServer([{
name: 'tsserver',
filetype: ['javascript', 'typescript'],
path: 'typescript-language-server',
args: ['--stdio'],
}])
endif

5
.config/vim/netrw.vim

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
" let g:netrw_keepdir=0
let g:netrw_altv=1 " split window to the right
let g:netrw_liststyle=3 " tree style listing
let g:netrw_list_hide=netrw_gitignore#Hide()
let g:netrw_winsize = 30

11
.config/vim/plugins.vim

@ -1,11 +0,0 @@ @@ -1,11 +0,0 @@
vim9script
plug#begin()
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'editorconfig/editorconfig-vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'rhysd/vim-clang-format'
plug#end()

42
.gitmodules vendored

@ -0,0 +1,42 @@ @@ -0,0 +1,42 @@
[submodule ".vim/pack/editor/opt/rainbow"]
path = .vim/pack/editor/opt/rainbow
url = https://github.com/luochen1990/rainbow
[submodule ".vim/pack/web/opt/vim-prettier"]
path = .vim/pack/web/opt/vim-prettier
url = https://github.com/prettier/vim-prettier
[submodule ".vim/pack/web/opt/vim-pug"]
path = .vim/pack/web/opt/vim-pug
url = https://github.com/digitaltoad/vim-pug
[submodule ".vim/pack/lsp/start/lsp"]
path = .vim/pack/lsp/start/lsp
url = https://github.com/yegappan/lsp
[submodule ".vim/pack/files/opt/SchemaStore.vim"]
path = .vim/pack/files/opt/SchemaStore.vim
url = https://github.com/00dani/SchemaStore.vim
[submodule ".vim/pack/files/opt/vim-cmake"]
path = .vim/pack/files/opt/vim-cmake
url = https://github.com/cdelledonne/vim-cmake.git
[submodule ".vim/pack/files/start/vim-gnupg"]
path = .vim/pack/files/start/vim-gnupg
url = https://github.com/jamessan/vim-gnupg.git
[submodule ".vim/pack/files/start/vim-markdown"]
path = .vim/pack/files/start/vim-markdown
url = https://github.com/preservim/vim-markdown.git
[submodule ".vim/pack/editor/start/editorconfig-vim"]
path = .vim/pack/editor/start/editorconfig-vim
url = https://github.com/editorconfig/editorconfig-vim.git
[submodule ".vim/pack/editor/start/papercolor-theme"]
path = .vim/pack/editor/start/papercolor-theme
url = https://github.com/NLKNguyen/papercolor-theme.git
[submodule ".vim/pack/editor/start/ultisnips"]
path = .vim/pack/editor/start/ultisnips
url = https://github.com/SirVer/ultisnips
[submodule ".vim/pack/editor/start/vim-gitgutter"]
path = .vim/pack/editor/start/vim-gitgutter
url = https://github.com/airblade/vim-gitgutter.git
[submodule ".vim/pack/editor/start/vim-healthcheck"]
path = .vim/pack/editor/start/vim-healthcheck
url = https://github.com/rhysd/vim-healthcheck
[submodule ".vim/pack/editor/start/vim-snippets"]
path = .vim/pack/editor/start/vim-snippets
url = https://github.com/honza/vim-snippets

1
.vim/pack/editor/opt/rainbow

@ -0,0 +1 @@ @@ -0,0 +1 @@
Subproject commit 76ca1a20aa42edb5c65c19029968aad4625790dc

1
.vim/pack/editor/start/editorconfig-vim

@ -0,0 +1 @@ @@ -0,0 +1 @@
Subproject commit 91bd0b0a2c6a72a110ab9feae335e1224480c233

1
.vim/pack/editor/start/papercolor-theme

@ -0,0 +1 @@ @@ -0,0 +1 @@
Subproject commit 0cfe64ffb24c21a6101b5f994ca342a74c977aef

1
.vim/pack/editor/start/ultisnips

@ -0,0 +1 @@ @@ -0,0 +1 @@
Subproject commit dbc458e110bb49299da76ec53f8b09b4f6dce28a

1
.vim/pack/editor/start/vim-gitgutter

@ -0,0 +1 @@ @@ -0,0 +1 @@
Subproject commit 6620e5fbbe6a28de0bfed081f5bd2767023b7eea

1
.vim/pack/editor/start/vim-healthcheck

@ -0,0 +1 @@ @@ -0,0 +1 @@
Subproject commit 45a95f6c98322410cffdcb4a1c8a9a44a25d18be

1
.vim/pack/editor/start/vim-snippets

@ -0,0 +1 @@ @@ -0,0 +1 @@
Subproject commit f0a3184d9f90b96b044d5914625a25c554d7f301

1
.vim/pack/files/opt/SchemaStore.vim

@ -0,0 +1 @@ @@ -0,0 +1 @@
Subproject commit 0daed059e5bd979402e67f3a5ab0e75b5bb895a6

1
.vim/pack/files/opt/vim-cmake

@ -0,0 +1 @@ @@ -0,0 +1 @@
Subproject commit 896bc2189c8ade62d00a0ebedc59c65d9d9b0d65

1
.vim/pack/files/start/vim-gnupg

@ -0,0 +1 @@ @@ -0,0 +1 @@
Subproject commit f9b608f29003dfde6450931dc0f495a912973a88

1
.vim/pack/files/start/vim-markdown

@ -0,0 +1 @@ @@ -0,0 +1 @@
Subproject commit 8f6cb3a6ca4e3b6bcda0730145a0b700f3481b51

1
.vim/pack/lsp/start/lsp

@ -0,0 +1 @@ @@ -0,0 +1 @@
Subproject commit 9f3d92ed7f3ba0ba5b496f0fd2150ce56b049832

1
.vim/pack/web/opt/vim-prettier

@ -0,0 +1 @@ @@ -0,0 +1 @@
Subproject commit 7dbdbb12c50a9f4ba72390cce2846248e4368fd0

1
.vim/pack/web/opt/vim-pug

@ -0,0 +1 @@ @@ -0,0 +1 @@
Subproject commit ea39cd942cf3194230cf72bfb838901a5344d3b3

24
.vim/scheme.vimrc

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
vim9script
g:rainbow_active = 1
g:rainbow_conf = {
'guifgs': ['royalblue3', 'darkorange3', 'seagreen3', 'firebrick'],
'ctermfgs': ['lightblue', 'lightyellow', 'lightcyan', 'lightmagenta'],
'guis': [''],
'cterms': [''],
'operators': '_,_',
'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/{/ end=/}/ fold'],
'separately': {
'*': 0,
'lisp': {
'guifgs': ['royalblue3', 'darkorange3', 'seagreen3', 'firebrick', 'darkorchid3'], # lisp needs more colors for parentheses :)
},
'scheme': {
'guifgs': ['royalblue3', 'darkorange3', 'seagreen3', 'firebrick', 'darkorchid3'], # and scheme too!
},
}
}
packadd rainbow
RainbowToggleOn

BIN
.vim/spell/ru.utf-8.spl

Binary file not shown.

45
.vim/web.vimrc

@ -0,0 +1,45 @@ @@ -0,0 +1,45 @@
vim9script
packadd vim-pug
packadd vim-prettier
packadd SchemaStore.vim
if executable("vue-language-server")
g:LspAddServer([{
name: 'vue-ls',
filetype: ['vue'],
path: 'vue-language-server',
args: ['--stdio'],
initializationOptions: {
typescript: {
tsdk: expand('$NVM_BIN/../lib/node_modules/typescript/lib')
},
vue: {
hybridMode: v:false
},
}
}])
endif
if executable("vscode-json-languageserver")
g:LspAddServer([{
name: 'vscode-json-language-server',
filetype: ['json', 'jsonc'],
path: expand('$NVM_BIN/vscode-json-languageserver'),
args: ['--stdio'],
workspaceConfig: {json: {
format: {enable: true},
validate: {enable: true},
schemas: g:SchemaStore#Schemata(),
}},
}])
endif
if executable("intelephense")
g:LspAddServer([{
name: 'intelephense',
filetype: ['php'],
path: expand('$NVM_BIN/intelephense'),
args: ['--stdio']
}])
endif

2
README.md

@ -5,7 +5,7 @@ My dotfiles. @@ -5,7 +5,7 @@ My dotfiles.
It contains
------------
Configs for:
* vim
* vim 9
* [zathura](https://git.pwmt.org/pwmt/zathura)
* [rofi](https://github.com/davatorium/rofi)

Loading…
Cancel
Save