diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-10-14 12:04:41 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-10-21 13:39:45 +0530 |
| commit | 2098f0001d584d1846b43c4a2003a175aeed62b0 (patch) | |
| tree | 42abc0e5546504d3815a0bdce117756d328fa172 /autoload/lsp-config.kak | |
| parent | 94bb19748d3bb8636cf252539b8f0be18f46515a (diff) | |
| download | kakoune-config-2098f0001d584d1846b43c4a2003a175aeed62b0.tar.gz kakoune-config-2098f0001d584d1846b43c4a2003a175aeed62b0.zip | |
Add marks clear + fix reordering issue
Diffstat (limited to '')
| -rw-r--r-- | autoload/lsp-config.kak | 68 |
1 files changed, 65 insertions, 3 deletions
diff --git a/autoload/lsp-config.kak b/autoload/lsp-config.kak index cea1f3d..c1c6cb9 100644 --- a/autoload/lsp-config.kak +++ b/autoload/lsp-config.kak @@ -1,14 +1,76 @@ eval %sh{kak-lsp} - +set-option global lsp_file_watch_support true +set-option global lsp_snippet_support true +set-option global lsp_diagnostic_line_error_sign '' +set-option global lsp_diagnostic_line_warning_sign '' +set-option global lsp_diagnostic_line_info_sign '■' +set-option global lsp_diagnostic_line_hint_sign '■' lsp-enable 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' + +map global insert <c-n> '<a-;>:lsp-snippets-select-next-placeholders<ret>' -docstring 'Select next snippet placeholder' +hook global InsertCompletionShow .* %{ + unmap global insert <c-n> '<a-;>:lsp-snippets-select-next-placeholders<ret>' +} +hook global InsertCompletionHide .* %{ + map global insert <c-n> '<a-;>:lsp-snippets-select-next-placeholders<ret>' -docstring 'Select next snippet placeholder' +} + +hook global BufSetOption filetype=(?:javascript|typescript) %{ + set-option buffer lsp_servers %{ + [typescript-language-server] + root_globs = ["package.json", "tsconfig.json", "jsconfig.json", ".git"] + args = ["--stdio"] + [tailwindcss-language-server] + root_globs = ["tailwind.*", "postcss.*"] + args = ["--stdio"] + [tailwindcss-language-server.settings.tailwindCSS] + editor = {} + [biome] + root_globs = ["biome.json", "package.json", "tsconfig.json", "jsconfig.json"] + args = ["lsp-proxy"] + } +} + +hook global BufSetOption filetype=ruby %{ + set-option buffer lsp_servers %{ + [ruby-lsp] + root_globs = ["Gemfile"] + args = ["stdio"] + } +} + +hook global WinSetOption filetype=(?:javascript|typescript|ruby) %{ + hook window -group semantic-tokens BufReload .* lsp-semantic-tokens + hook window -group semantic-tokens NormalIdle .* lsp-semantic-tokens + hook window -group semantic-tokens InsertIdle .* lsp-semantic-tokens + hook -once -always window WinSetOption filetype=.* %{ + remove-hooks window semantic-tokens + } + + set-option window lsp_semantic_tokens %{ + [ + {face="documentation", token="comment", modifiers=["documentation"]}, + {face="comment", token="comment"}, + {face="function", token="function"}, + {face="function", token="method"}, + {face="keyword", token="keyword"}, + {face="module", token="namespace"}, + {face="operator", token="operator"}, + {face="string", token="string"}, + {face="type", token="type"}, + {face="variable", token="variable"}, + {face="const_variable", token="variable", modifiers=["readonly"]}, + {face="const_variable", token="variable", modifiers=["constant"]}, + ] + } +} + |
