AutoYADM commit: 2025-05-26 19:47:39
This commit is contained in:
parent
1fb2d25ebe
commit
f3c7108572
2 changed files with 34 additions and 1 deletions
|
@ -26,6 +26,28 @@ set-option global lsp_debug false
|
||||||
# list of filetypes for which LSP will be activated in the window scope
|
# list of filetypes for which LSP will be activated in the window scope
|
||||||
declare-option str-list lsp_filetypes python go rust bash fish c cpp typst markdown yaml json jsonc bash sh
|
declare-option str-list lsp_filetypes python go rust bash fish c cpp typst markdown yaml json jsonc bash sh
|
||||||
|
|
||||||
|
declare-option -hidden bool inlay_enabled false
|
||||||
|
|
||||||
|
define-command -hidden inlay-on %{
|
||||||
|
lsp-inlay-hints-enable window
|
||||||
|
set-option window inlay_enabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
define-command -hidden inlay-off %{
|
||||||
|
lsp-inlay-hints-disable window
|
||||||
|
set-option window inlay_enabled false
|
||||||
|
}
|
||||||
|
|
||||||
|
define-command -hidden inlay-toggle %{
|
||||||
|
evaluate-commands %sh{
|
||||||
|
if [ "$kak_opt_inlay_enabled" = "true" ]; then
|
||||||
|
echo "inlay-off"
|
||||||
|
else
|
||||||
|
echo "inlay-on"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
define-command -hidden lsp-filetype-hooks-update %{
|
define-command -hidden lsp-filetype-hooks-update %{
|
||||||
try %{ remove-hooks global lsp-filetypes }
|
try %{ remove-hooks global lsp-filetypes }
|
||||||
# convert the str-list into regex of form (a|b|c|...)
|
# convert the str-list into regex of form (a|b|c|...)
|
||||||
|
@ -34,7 +56,13 @@ define-command -hidden lsp-filetype-hooks-update %{
|
||||||
}~ %{
|
}~ %{
|
||||||
# commands to execute for lsp window settings
|
# commands to execute for lsp window settings
|
||||||
lsp-enable-window
|
lsp-enable-window
|
||||||
lsp-inlay-hints-enable window
|
inlay-on
|
||||||
|
try %{
|
||||||
|
# only map to UI mode if that module is available
|
||||||
|
map -docstring 'toggle inlay hints' window ui h ': inlay-toggle<ret>'
|
||||||
|
} catch %{
|
||||||
|
map -docstring 'toggle inlay hints' window lsp <a-h> ': inlay-toggle<ret>'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lsp-filetype-hooks-update
|
lsp-filetype-hooks-update
|
||||||
|
|
5
.config/kak/autoload/toggle.kak
Normal file
5
.config/kak/autoload/toggle.kak
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# module provides utils for toggling stuff lol
|
||||||
|
provide-module toggle %~
|
||||||
|
|
||||||
|
|
||||||
|
~
|
Loading…
Add table
Add a link
Reference in a new issue