Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
UserConfig
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jiří Kalvoda
UserConfig
Commits
1a7ab06a
Commit
1a7ab06a
authored
1 year ago
by
Jiří Kalvoda
Browse files
Options
Downloads
Patches
Plain Diff
VIM cleanup in nvim plugins
parent
91712c91
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
vim/init-plugins.sh
+26
-0
26 additions, 0 deletions
vim/init-plugins.sh
vim/nvim.vim
+2
-170
2 additions, 170 deletions
vim/nvim.vim
vim/plugins_conf.vim
+112
-0
112 additions, 0 deletions
vim/plugins_conf.vim
vim/vimrc
+3
-1
3 additions, 1 deletion
vim/vimrc
with
143 additions
and
171 deletions
vim/init-plugins.sh
0 → 100755
+
26
−
0
View file @
1a7ab06a
#!/bin/bash
cd
"
$(
dirname
"
$0
"
)
"
.
../userconfig-lib.sh
install_begin
confln plugins_conf.vim ~/.config/nvim/
d
=
~/.config/nvim/pack/plugins/start
mkdir
-p
$d
r git_clupdate https://github.com/hrsh7th/cmp-buffer
$d
/cmp-buffer
r git_clupdate https://github.com/hrsh7th/cmp-cmdline
$d
/cmp-cmdline
r git_clupdate https://github.com/hrsh7th/cmp-nvim-lsp
$d
/cmp-nvim-lsp
r git_clupdate https://github.com/hrsh7th/cmp-path
$d
/cmp-path
r git_clupdate https://github.com/nvimdev/lspsaga.nvim.git
$d
/lspsaga.nvim
r git_clupdate https://github.com/hrsh7th/nvim-cmp
$d
/nvim-cmp
r git_clupdate https://github.com/neovim/nvim-lspconfig.git
$d
/nvim-lspconfig
r git_clupdate https://github.com/nvim-treesitter/nvim-treesitter.git
$d
/nvim-treesitter
r git_clupdate https://github.com/nvim-treesitter/nvim-treesitter-textobjects
$d
/nvim-treesitter-textobjects
r git_clupdate https://github.com/godlygeek/tabular.git
$d
/tabular
r git_clupdate https://github.com/mbbill/undotree
$d
/undotree
install_ok
This diff is collapsed.
Click to expand it.
vim/nvim.vim
+
2
−
170
View file @
1a7ab06a
...
@@ -11,181 +11,13 @@ function! ExecHere()
...
@@ -11,181 +11,13 @@ function! ExecHere()
let
g:toExec
=
""
let
g:toExec
=
""
endfunction
endfunction
packadd
plug
call
plug#begin
(
"~/.config/nvim/plugged"
)
Plug
'glacambre/firenvim'
,
{
'do'
:
{
_
->
firenvim#install
(
0
)
}
}
Plug
'neovim/nvim-lspconfig'
call
plug#end
()
" Exceptions for Firenvim
" Exceptions for Firenvim
if
exists
(
'g:started_by_firenvim'
)
if
exists
(
'g:started_by_firenvim'
)
set
laststatus
=
0
set
laststatus
=
0
endif
endif
" Language server
if
!
empty
(
expand
(
glob
(
"~/.config/nvim/plugins_conf.vim"
)))
lua
<<
AMEN
so
~
/.config/
nvim/plugins_conf
.
vim
require
'lspconfig'
.
pylsp
.
setup
{
log_level
=
vim
.
lsp
.
protocol
.
MessageType
.
Log
,
--
message_level
=
vim
.
lsp
.
protocol
.
MessageType
.
Error
,
settings
=
{
pylsp
=
{
plugins
=
{
pycodestyle
=
{
enabled
=
true
,
--
see
~
/.config/
pycodestyle
},
pylsp_mypy
=
{
enabled
=
true
,
},
},
}
},
}
AMEN
" Language server
" lua <<AMEN
" require'lspconfig'.pylsp.setup{
" log_file = "/tmp/lsplog",
" log_level = vim.lsp.protocol.MessageType.Log,
" -- message_level = vim.lsp.protocol.MessageType.Error,
" settings = {
" pylsp = {
" plugins = {
" pycodestyle = {
" enabled = true,
" -- see ~/.config/pycodestyle
" },
" pylsp_mypy = {
" enabled = true,
" },
" },
" }
" },
" }
" AMEN
highlight
LspDiagnosticsDefaultError ctermfg
=
red
highlight
LspDiagnosticsDefaultWarning ctermfg
=
yellow
highlight
LspDiagnosticsDefaultInformation ctermfg
=
cyan
highlight
LspDiagnosticsDefaultHint ctermfg
=
cyan
set
signcolumn
=
yes
:
1
highlight
SignColumn ctermbg
=
black
autocmd Filetype
python
setlocal
omnifunc
=
v
:
lua
.
vim
.
lsp
.
omnifunc
function
!
s:termclose
()
abort
q
endfunction
autocmd TermClose *
:
$SHELL
,
*
:
\$SHELL
call
s:termclose
()
tnoremap
<
silent
>
<
C
-[><
C
-[>
<
C
-
\
><
C
-
n
>
autocmd TermOpen *
setlocal
nonumber
norelativenumber
nospell
"au TermOpen * au <buffer> BufEnter,WinEnter redraw!
"augroup terminal_settings
"autocmd!
"autocmd BufWinEnter,WinEnter te
"autocmd BufWinEnter,WinEnter term://* startinsert
"autocmd BufLeave term://* stopinsert
" Ignore various filetypes as those will close terminal automatically
" Ignore fzf, ranger, coc
"autocmd TermClose term://*
"\ if (expand('<afile>') !~ "fzf") && (expand('<afile>') !~ "ranger") && (expand('<afile>') !~ "coc") |
"\ call nvim_input('<CR>') |
"\ endif
augroup END
" Use the vim-plug plugin manager: https://github.com/junegunn/vim-plug
" Remember to run :PlugInstall when loading this vimrc for the first time, so
" vim-plug downloads the plugins listed.
call
plug#begin
(
"~/.config/nvim/plugged"
)
Plug
'OmniSharp/omnisharp-vim'
Plug
'dense-analysis/ale'
call
plug#end
()
" Don't autoselect first omnicomplete option, show options even if there is only
" one (so the preview documentation is accessible). Remove 'preview', 'popup'
" and 'popuphidden' if you don't want to see any documentation whatsoever.
" Note that neovim does not support `popuphidden` or `popup` yet:
" https://github.com/neovim/neovim/issues/10996
if
has
(
'patch-8.1.1880'
)
set
completeopt
=
longest
,
menuone
,
popuphidden
" Highlight the completion documentation popup background/foreground the same as
" the completion menu itself, for better readability with highlighted
" documentation.
set
completepopup
=
highlight
:
Pmenu
,
border
:
off
else
set
completeopt
=
longest
,
menuone
,
preview
" Set desired preview window height for viewing documentation.
set
previewheight
=
5
endif
endif
" Tell ALE to use OmniSharp for linting C# files, and no other linters.
let
g:ale_linters
=
{
'cs'
:
[
'OmniSharp'
]
}
augroup omnisharp_commands
autocmd
!
" Show type information automatically when the cursor stops moving.
" Note that the type is echoed to the Vim command line, and will overwrite
" any other messages in this space including e.g. ALE linting messages.
autocmd
CursorHold
*
.
cs
OmniSharpTypeLookup
" The following commands are contextual, based on the cursor position.
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
<
Leader
><
Leader
>
d
<
Plug
>(
omnisharp_go_to_definition
)
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
<
Leader
><
Leader
>
u
<
Plug
>(
omnisharp_find_usages
)
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
<
Leader
><
Leader
>
i
<
Plug
>(
omnisharp_find_implementations
)
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
<
Leader
><
Leader
>
pd
<
Plug
>(
omnisharp_preview_definition
)
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
<
Leader
><
Leader
>
pi
<
Plug
>(
omnisharp_preview_implementations
)
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
<
Leader
><
Leader
>
t
<
Plug
>(
omnisharp_type_lookup
)
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
<
Leader
><
Leader
>
d
<
Plug
>(
omnisharp_documentation
)
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
<
Leader
><
Leader
>
s
<
Plug
>(
omnisharp_find_symbol
)
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
<
Leader
><
Leader
>
f
<
Plug
>(
omnisharp_fix_usings
)
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
<
Leader
><
Leader
>
h
<
Plug
>(
omnisharp_signature_help
)
autocmd
FileType
cs
imap
<
silent
>
<
buffer
>
<
C
-
\
>
<
Plug
>(
omnisharp_signature_help
)
" Navigate up and down by method/property/field
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
[[
<
Plug
>(
omnisharp_navigate_up
)
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
]]
<
Plug
>(
omnisharp_navigate_down
)
" Find all code errors/warnings for the current solution and populate the quickfix window
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
<
Leader
><
Leader
>
cc
<
Plug
>(
omnisharp_global_code_check
)
" Contextual code actions (uses fzf, vim-clap, CtrlP or unite.vim selector when available)
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
<
Leader
><
Leader
>
ca
<
Plug
>(
omnisharp_code_actions
)
" Repeat the last code action performed (does not use a selector)
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
<
Leader
><
Leader
>.
<
Plug
>(
omnisharp_code_action_repeat
)
autocmd
FileType
cs
xmap
<
silent
>
<
buffer
>
<
Leader
><
Leader
>.
<
Plug
>(
omnisharp_code_action_repeat
)
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
<
Leader
><
Leader
>=
<
Plug
>(
omnisharp_code_format
)
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
<
Leader
><
Leader
>
r
<
Plug
>(
omnisharp_rename
)
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
<
Leader
><
Leader
>
R
<
Plug
>(
omnisharp_restart_server
)
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
<
Leader
><
Leader
>
S
<
Plug
>(
omnisharp_start_server
)
autocmd
FileType
cs
nmap
<
silent
>
<
buffer
>
<
Leader
><
Leader
>
E
<
Plug
>(
omnisharp_stop_server
)
augroup END
autocmd
FileType
python
nmap
<
silent
>
<
Leader
><
Leader
>
D
<
cmd
>
lua
vim
.
lsp
.
buf
.
declaration
()<
CR
>
autocmd
FileType
python
nmap
<
silent
>
<
Leader
><
Leader
>
d
<
cmd
>
lua
vim
.
lsp
.
buf
.
definition
()<
CR
>
autocmd
FileType
python
nmap
<
silent
>
<
Leader
><
Leader
>
K
<
cmd
>
lua
vim
.
lsp
.
buf
.
hover
()<
CR
>
autocmd
FileType
python
nmap
<
silent
>
<
Leader
><
Leader
>
i
<
cmd
>
lua
vim
.
lsp
.
buf
.
implementation
()<
CR
>
autocmd
FileType
python
nmap
<
silent
>
<
Leader
><
Leader
>
h
<
cmd
>
lua
vim
.
lsp
.
buf
.
signature_help
()<
CR
>
autocmd
FileType
python
nmap
<
silent
>
<
Leader
><
Leader
>
t
<
cmd
>
lua
vim
.
lsp
.
buf
.
type_definition
()<
CR
>
autocmd
FileType
python
nmap
<
silent
>
<
Leader
><
Leader
>
R
<
cmd
>
lua
vim
.
lsp
.
buf
.
references
()<
CR
>
autocmd
FileType
python
nmap
<
silent
>
<
Leader
><
Leader
>
r
<
cmd
>
lua
vim
.
lsp
.
buf
.
rename
()<
CR
>
autocmd
FileType
python
nmap
<
silent
>
<
Leader
><
Leader
>
s
<
cmd
>
lua
vim
.
lsp
.
buf
.
document_symbol
()<
CR
>
autocmd
FileType
python
nmap
<
silent
>
<
Leader
><
Leader
>
W
<
cmd
>
lua
vim
.
lsp
.
buf
.
workspace_symbol
()<
CR
>
autocmd
FileType
python
nmap
<
silent
>
<
Leader
><
Leader
>
f
<
cmd
>
lua
vim
.
diagnostic
.
open_float
()<
CR
>
" Enable snippet completion, using the ultisnips plugin
" let g:OmniSharp_want_snippet=1
This diff is collapsed.
Click to expand it.
vim/plugins_conf.vim
0 → 100644
+
112
−
0
View file @
1a7ab06a
" Language server
lua
<<
AMEN
require
'lspconfig'
.
pylsp
.
setup
{
log_level
=
vim
.
lsp
.
protocol
.
MessageType
.
Log
,
--
message_level
=
vim
.
lsp
.
protocol
.
MessageType
.
Error
,
settings
=
{
pylsp
=
{
plugins
=
{
pycodestyle
=
{
enabled
=
true
,
--
see
~
/.config/
pycodestyle
},
pylsp_mypy
=
{
enabled
=
true
,
},
},
}
},
}
AMEN
highlight
LspDiagnosticsDefaultError ctermfg
=
red
highlight
LspDiagnosticsDefaultWarning ctermfg
=
yellow
highlight
LspDiagnosticsDefaultInformation ctermfg
=
cyan
highlight
LspDiagnosticsDefaultHint ctermfg
=
cyan
set
signcolumn
=
yes
:
1
highlight
SignColumn ctermbg
=
black
autocmd Filetype
python
setlocal
omnifunc
=
v
:
lua
.
vim
.
lsp
.
omnifunc
" Experiments with lspsaga by MJ
lua
<<
AMEN
local saga
=
require
'lspsaga'
saga
.
setup
({
symbol_in_winbar
=
{
enable
=
false
,
}
})
local
keymap
=
vim
.
keymap
.
set
keymap
(
"n"
,
"gh"
,
"<cmd>Lspsaga lsp_finder<CR>"
)
keymap
({
"n"
,
"v"
},
"<Bslash>ca"
,
"<cmd>Lspsaga code_action<CR>"
)
keymap
(
"n"
,
"gr"
,
"<cmd>Lspsaga rename<CR>"
)
keymap
(
"n"
,
"gr"
,
"<cmd>Lspsaga rename ++project<CR>"
)
keymap
(
"n"
,
"gp"
,
"<cmd>Lspsaga peek_definition<CR>"
)
keymap
(
"n"
,
"gd"
,
"<cmd>Lspsaga goto_definition<CR>"
)
keymap
(
"n"
,
"gp"
,
"<cmd>Lspsaga peek_type_definition<CR>"
)
keymap
(
"n"
,
"<Bslash>d"
,
"<cmd>Lspsaga show_line_diagnostics<CR>"
)
keymap
(
"n"
,
"<Bslash>D"
,
"<cmd>Lspsaga show_buf_diagnostics<CR>"
)
keymap
(
"n"
,
"[e"
,
"<cmd>Lspsaga diagnostic_jump_prev<CR>"
)
keymap
(
"n"
,
"]e"
,
"<cmd>Lspsaga diagnostic_jump_next<CR>"
)
keymap
(
"n"
,
"[E"
,
function
()
require
(
"lspsaga.diagnostic"
):
goto_prev
({
severity
=
vim
.
diagnostic
.
severity
.
ERROR
})
end
)
keymap
(
"n"
,
"]E"
,
function
()
require
(
"lspsaga.diagnostic"
):
goto_next
({
severity
=
vim
.
diagnostic
.
severity
.
ERROR
})
end
)
keymap
(
"n"
,
"K"
,
"<cmd>Lspsaga hover_doc ++quiet<CR>"
)
keymap
(
"n"
,
"<Leader>ci"
,
"<cmd>Lspsaga incoming_calls<CR>"
)
keymap
(
"n"
,
"<Leader>co"
,
"<cmd>Lspsaga outgoing_calls<CR>"
)
AMEN
" Completion via nvim-cmp by MJ
lua
<<
EOF
--
Setup nvim
-
cmp
.
local
cmp
=
require
'cmp'
cmp
.
setup
({
completion
=
{
--
autocomplete
=
false
,
},
window
=
{
completion
=
cmp
.
config
.
window
.
bordered
(),
documentation
=
cmp
.
config
.
window
.
bordered
(),
},
mapping
=
cmp
.
mapping
.
preset
.
insert
({
--
[
'<C-b>'
]
=
cmp
.
mapping
.
scroll_docs
(
-4
),
--
[
'<C-f>'
]
=
cmp
.
mapping
.
scroll_docs
(
4
),
--
[
'<C-Space>'
]
=
cmp
.
mapping
.
complete
(),
[
'<C-e>'
]
=
cmp
.
mapping
.
abort
(),
[
'<A-Tab>'
]
=
cmp
.
mapping
.
confirm
({
select
=
true
}),
--
Accept currently selected item
.
Set `select`
to
`false`
to
only
confirm
explicitly selected
items
.
[
"<C-n>"
]
=
cmp
.
config
.
disable
,
[
"<C-p>"
]
=
cmp
.
config
.
disable
,
}),
sources
=
cmp
.
config
.
sources
({
{
name
=
'nvim_lsp'
},
},
{
{
name
=
'buffer'
},
})
})
--
Setup lspconfig
.
local capabilities
=
require
(
'cmp_nvim_lsp'
).
default_capabilities
(
vim
.
lsp
.
protocol
.
make_client_capabilities
())
require
(
'lspconfig'
)[
'pylsp'
].
setup
{
capabilities
=
capabilities
}
EOF
" inoremap <silent> <A-Tab> <Cmd>lua require('cmp').complete()<CR>
" autocmd FileType python nmap <silent> <Leader><Leader>D <cmd>lua vim.lsp.buf.declaration()<CR>
" autocmd FileType python nmap <silent> <Leader><Leader>d <cmd>lua vim.lsp.buf.definition()<CR>
" autocmd FileType python nmap <silent> <Leader><Leader>K <cmd>lua vim.lsp.buf.hover()<CR>
" autocmd FileType python nmap <silent> <Leader><Leader>i <cmd>lua vim.lsp.buf.implementation()<CR>
" autocmd FileType python nmap <silent> <Leader><Leader>h <cmd>lua vim.lsp.buf.signature_help()<CR>
" autocmd FileType python nmap <silent> <Leader><Leader>t <cmd>lua vim.lsp.buf.type_definition()<CR>
" autocmd FileType python nmap <silent> <Leader><Leader>R <cmd>lua vim.lsp.buf.references()<CR>
" autocmd FileType python nmap <silent> <Leader><Leader>r <cmd>lua vim.lsp.buf.rename()<CR>
" autocmd FileType python nmap <silent> <Leader><Leader>s <cmd>lua vim.lsp.buf.document_symbol()<CR>
" autocmd FileType python nmap <silent> <Leader><Leader>W <cmd>lua vim.lsp.buf.workspace_symbol()<CR>
" autocmd FileType python nmap <silent> <Leader><Leader>f <cmd>lua vim.diagnostic.open_float()<CR>
" Enable snippet completion, using the ultisnips plugin
" let g:OmniSharp_want_snippet=1
This diff is collapsed.
Click to expand it.
vim/vimrc
+
3
−
1
View file @
1a7ab06a
...
@@ -154,6 +154,8 @@ let g:VimRun = ""
...
@@ -154,6 +154,8 @@ let g:VimRun = ""
let g:useVimRun = 0
let g:useVimRun = 0
hi clear SpellBad
hi SpellBad cterm=underline ctermfg=009
command! -nargs=+ AddExecF let g:toExec = g:toExec . <q-args>
command! -nargs=+ AddExecF let g:toExec = g:toExec . <q-args>
command! -nargs=+ AddExec AddExecF promt; echo <q-args>; <args>;
command! -nargs=+ AddExec AddExecF promt; echo <q-args>; <args>;
...
@@ -575,7 +577,7 @@ endfunction
...
@@ -575,7 +577,7 @@ endfunction
function ListCharsDefault()
function ListCharsDefault()
se list
se list
set listchars=tab:>-
set listchars=tab:>-
,trail:·,nbsp:~
syntax on
syntax on
endfunction
endfunction
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment