AutoYADM commit: 2025-05-24 16:42:39
This commit is contained in:
parent
ecef17a8f5
commit
cf46ae2f4d
1 changed files with 38 additions and 19 deletions
|
@ -15,24 +15,43 @@ map global object D '<a-semicolon>lsp-diagnostic-object<ret>' -docstring 'LSP er
|
||||||
|
|
||||||
# override the code actions icon in the modeline
|
# override the code actions icon in the modeline
|
||||||
define-command -hidden -override lsp-show-code-actions -params 1.. %{
|
define-command -hidden -override lsp-show-code-actions -params 1.. %{
|
||||||
set-option buffer lsp_modeline_code_actions ""
|
set-option buffer lsp_modeline_code_actions ""
|
||||||
}
|
}
|
||||||
define-command -hidden -override lsp-hide-code-actions %{
|
define-command -hidden -override lsp-hide-code-actions %{
|
||||||
set-option buffer lsp_modeline_code_actions ""
|
set-option buffer lsp_modeline_code_actions ""
|
||||||
}
|
}
|
||||||
# Server Config
|
# Server Config
|
||||||
set-option global lsp_debug false
|
set-option global lsp_debug false
|
||||||
|
|
||||||
declare-option str-list lsp_filetypes python go rust bash fish typst yaml json jsonc
|
# list of filetypes for which LSP will be activated in the window scope
|
||||||
|
declare-option str-list lsp_filetypes python %{
|
||||||
|
# programming
|
||||||
|
python
|
||||||
|
go
|
||||||
|
rust
|
||||||
|
bash
|
||||||
|
fish
|
||||||
|
c
|
||||||
|
cpp
|
||||||
|
# markup
|
||||||
|
typst
|
||||||
|
markdown
|
||||||
|
# config
|
||||||
|
yaml
|
||||||
|
json
|
||||||
|
jsonc
|
||||||
|
}
|
||||||
|
|
||||||
define-command -hidden lsp-filetype-hooks-update %{
|
define-command -hidden lsp-filetype-hooks-update %{
|
||||||
try %{ remove-hooks window lsp-filetypes }
|
try %{ remove-hooks window lsp-filetypes }
|
||||||
# convert the str-list into regex of form (a|b|c|...)
|
# convert the str-list into regex of form (a|b|c|...)
|
||||||
hook -group lsp-filetypes global WinSetOption %exp~filetype=%sh{
|
hook -group lsp-filetypes global WinSetOption %exp~filetype=%sh{
|
||||||
printf '%s' "(${kak_opt_lsp_filetypes// /|})"
|
printf '%s' "(${kak_opt_lsp_filetypes// /|})"
|
||||||
}~ %{
|
}~ %{
|
||||||
lsp-enable-window
|
# commands to execute for lsp window settings
|
||||||
lsp-inlay-hints-enable window
|
lsp-enable-window
|
||||||
}
|
lsp-inlay-hints-enable window
|
||||||
|
}
|
||||||
}
|
}
|
||||||
lsp-filetype-hooks-update
|
lsp-filetype-hooks-update
|
||||||
|
|
||||||
|
@ -52,18 +71,18 @@ hook -group lsp-filetype-python global BufSetOption filetype=python %{
|
||||||
args = ["--stdio"]
|
args = ["--stdio"]
|
||||||
settings_section = "basedpyright"
|
settings_section = "basedpyright"
|
||||||
[basedpyright-langserver.settings.basedpyright.analysis]
|
[basedpyright-langserver.settings.basedpyright.analysis]
|
||||||
typeCheckingMode = "standard"
|
typeCheckingMode = "standard"
|
||||||
inlayHints.genericTypes = true
|
inlayHints.genericTypes = true
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# use our custom fish-lsp wrapper because it sets env vars
|
# use our custom fish-lsp wrapper because it sets env vars
|
||||||
hook -group lsp-filetype-fish global BufSetOption filetype=fish %{
|
hook -group lsp-filetype-fish global BufSetOption filetype=fish %{
|
||||||
set-option buffer lsp_servers %{
|
set-option buffer lsp_servers %{
|
||||||
[fish-lsp]
|
[fish-lsp]
|
||||||
root_globs = [".git"]
|
root_globs = [".git"]
|
||||||
args = ["start"]
|
args = ["start"]
|
||||||
command = "/home/fic/.config/kak/scripts/fish-lsp.fish"
|
command = "/home/fic/.config/kak/scripts/fish-lsp.fish"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue