48 lines
1.9 KiB
Text
48 lines
1.9 KiB
Text
# load plugin
|
|
eval %sh{kak-lsp}
|
|
lsp-enable
|
|
|
|
# mappings
|
|
map global user l ': enter-user-mode lsp<ret>' -docstring 'LSP mode'
|
|
|
|
map global insert <tab> '<a-;>:try lsp-snippets-select-next-placeholders catch %{ execute-keys -with-hooks <lt>tab> }<ret>' -docstring 'Select next snippet placeholder'
|
|
|
|
map global object a '<a-semicolon>lsp-object<ret>' -docstring 'LSP any symbol'
|
|
map global object <a-a> '<a-semicolon>lsp-object<ret>' -docstring 'LSP any symbol'
|
|
map global object f '<a-semicolon>lsp-object Function Method<ret>' -docstring 'LSP function or method'
|
|
map global object t '<a-semicolon>lsp-object Class Interface Struct<ret>' -docstring 'LSP class interface or struct'
|
|
map global object d '<a-semicolon>lsp-diagnostic-object --include-warnings<ret>' -docstring 'LSP errors and warnings'
|
|
map global object D '<a-semicolon>lsp-diagnostic-object<ret>' -docstring 'LSP errors'
|
|
|
|
# set-option global lsp_auto_highlight_references false
|
|
set-option global lsp_auto_show_code_actions true
|
|
set-option global lsp_code_action_indicator ''
|
|
# Server Config
|
|
set-option global lsp_debug false
|
|
lsp-inlay-hints-enable global
|
|
# TODO: set up toggle binding for this
|
|
# lsp-inlay-diagnostics-enable global
|
|
|
|
remove-hooks global lsp-filetype-python
|
|
hook -group lsp-filetype-python global BufSetOption filetype=python %{
|
|
set-option buffer lsp_servers %{
|
|
[basedpyright-langserver]
|
|
root_globs = ["requirements.txt", "setup.py", "pyproject.toml", "pyrightconfig.json", ".git", ".hg"]
|
|
args = ["--stdio"]
|
|
settings_section = "basedpyright"
|
|
[basedpyright-langserver.settings.basedpyright.analysis]
|
|
typeCheckingMode = "standard"
|
|
inlayHints.genericTypes = true
|
|
|
|
}
|
|
}
|
|
|
|
# remove-hooks global lsp-filetype-fish
|
|
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"
|
|
}
|
|
}
|