From 2098f0001d584d1846b43c4a2003a175aeed62b0 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Tue, 14 Oct 2025 12:04:41 +0530 Subject: Add marks clear + fix reordering issue --- autoload/lsp-config.kak | 68 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 3 deletions(-) (limited to 'autoload/lsp-config.kak') 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' -docstring 'LSP mode' -map global insert ':try lsp-snippets-select-next-placeholders catch %{ execute-keys -with-hooks tab> }' -docstring 'Select next snippet placeholder' - map global object a 'lsp-object' -docstring 'LSP any symbol' map global object 'lsp-object' -docstring 'LSP any symbol' map global object f 'lsp-object Function Method' -docstring 'LSP function or method' map global object t 'lsp-object Class Interface Struct' -docstring 'LSP class interface or struct' map global object d 'lsp-diagnostic-object --include-warnings' -docstring 'LSP errors and warnings' map global object D 'lsp-diagnostic-object' -docstring 'LSP errors' + +map global insert ':lsp-snippets-select-next-placeholders' -docstring 'Select next snippet placeholder' +hook global InsertCompletionShow .* %{ + unmap global insert ':lsp-snippets-select-next-placeholders' +} +hook global InsertCompletionHide .* %{ + map global insert ':lsp-snippets-select-next-placeholders' -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"]}, + ] + } +} + -- cgit v1.3.1