AutoYADM commit: 2025-07-21 14:24:10

This commit is contained in:
Daniel Fichtinger 2025-07-21 14:24:10 -04:00
parent 6cf79124d2
commit 4f650b2002

View file

@ -62,6 +62,7 @@ define-command -override lsp-progress-enable %{
# mappings
map global user k ': lsp-hover<ret>' -docstring 'LSP hover'
map global user l ': enter-user-mode lsp<ret>' -docstring 'LSP mode'
map global lsp L ': lsp-code-lens<ret>'
map global insert <tab> '<a-;>:try lsp-snippets-select-next-placeholders catch %{ execute-keys -with-hooks <lt>tab> }<ret>' -docstring 'Select next snippet placeholder'
@ -145,15 +146,10 @@ define-command inline-diagnostics-toggle %{
}
}
define-command -hidden lsp-filetype-hooks-update %{
try %{ remove-hooks global lsp-filetypes }
# convert the str-list into regex of form (a|b|c|...)
hook -group lsp-filetypes global WinSetOption %exp~filetype=%sh{
printf '%s\n' "($kak_opt_lsp_filetypes)" | sed 's/ /|/g'
}~ %{
define-command lsp-on %{
# commands to execute for lsp window settings
lsp-enable-window
inlay-on
try %{inlay-on}
# hooks to disable inline diagnostics while typing
hook -group dynamic-inline-diags window ModeChange (push|pop):.*insert %{
@ -168,6 +164,22 @@ define-command -hidden lsp-filetype-hooks-update %{
map -docstring 'toggle inlay diagnostics' window ui d ': inlay-diagnostics-toggle<ret>'
map -docstring 'toggle inline diagnostics' window ui e ': inline-diagnostics-toggle<ret>'
trigger-user-hook lsp-enabled
}
define-command lsp-off %{
lsp-disable-window
}
map -docstring 'lsp on' global lsp l ': lsp-on<ret>'
map -docstring 'lsp off' global lsp <a-l> ': lsp-off<ret>'
define-command -hidden lsp-filetype-hooks-update %{
try %{ remove-hooks global lsp-filetypes }
# convert the str-list into regex of form (a|b|c|...)
hook -group lsp-filetypes global WinSetOption %exp~filetype=%sh{
printf '%s\n' "($kak_opt_lsp_filetypes)" | sed 's/ /|/g'
}~ %{
lsp-on
}
}
lsp-filetype-hooks-update