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
|
||||
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 %{
|
||||
set-option buffer lsp_modeline_code_actions ""
|
||||
set-option buffer lsp_modeline_code_actions ""
|
||||
}
|
||||
# Server Config
|
||||
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 %{
|
||||
try %{ remove-hooks window lsp-filetypes }
|
||||
# convert the str-list into regex of form (a|b|c|...)
|
||||
hook -group lsp-filetypes global WinSetOption %exp~filetype=%sh{
|
||||
printf '%s' "(${kak_opt_lsp_filetypes// /|})"
|
||||
}~ %{
|
||||
lsp-enable-window
|
||||
lsp-inlay-hints-enable window
|
||||
}
|
||||
try %{ remove-hooks window lsp-filetypes }
|
||||
# convert the str-list into regex of form (a|b|c|...)
|
||||
hook -group lsp-filetypes global WinSetOption %exp~filetype=%sh{
|
||||
printf '%s' "(${kak_opt_lsp_filetypes// /|})"
|
||||
}~ %{
|
||||
# commands to execute for lsp window settings
|
||||
lsp-enable-window
|
||||
lsp-inlay-hints-enable window
|
||||
}
|
||||
}
|
||||
lsp-filetype-hooks-update
|
||||
|
||||
|
@ -52,18 +71,18 @@ hook -group lsp-filetype-python global BufSetOption filetype=python %{
|
|||
args = ["--stdio"]
|
||||
settings_section = "basedpyright"
|
||||
[basedpyright-langserver.settings.basedpyright.analysis]
|
||||
typeCheckingMode = "standard"
|
||||
inlayHints.genericTypes = true
|
||||
typeCheckingMode = "standard"
|
||||
inlayHints.genericTypes = true
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
# use our custom fish-lsp wrapper because it sets env vars
|
||||
hook -group lsp-filetype-fish global BufSetOption filetype=fish %{
|
||||
set-option buffer lsp_servers %{
|
||||
[fish-lsp]
|
||||
root_globs = [".git"]
|
||||
args = ["start"]
|
||||
command = "/home/fic/.config/kak/scripts/fish-lsp.fish"
|
||||
}
|
||||
set-option buffer lsp_servers %{
|
||||
[fish-lsp]
|
||||
root_globs = [".git"]
|
||||
args = ["start"]
|
||||
command = "/home/fic/.config/kak/scripts/fish-lsp.fish"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue