diff --git a/snippets/kakoune.nix b/snippets/kakoune.nix index 8d9ee02..02d5c29 100644 --- a/snippets/kakoune.nix +++ b/snippets/kakoune.nix @@ -42,15 +42,6 @@ option = "filetype=markdown"; commands = "set-option window lintcmd \"proselint\""; } - # { - # name = "BufSetOption"; - # option = "filetype=markdown"; - # commands = '' - # hook buffer BufWritePost .* %{ %sh{ - # - # } }; - # ''; - # } ]; keyMappings = [ # Define select all @@ -60,25 +51,10 @@ effect = "*%s"; docstring = "Select all"; } - # Define usermode yank/copy and paste - { - key = "y"; - mode = "user"; - effect = " wl-copy"; - } - { - key = "p"; - mode = "user"; - effect = " wl-paste -n"; - } - { - key = "P"; - mode = "user"; - effect = "! wl-paste -n"; - } ]; }; - extraConfig = '' + extraConfig = + '' # highlight trailing whitespace add-highlighter global/trailing-whitespace regex '\h+$' 0:Error @@ -93,7 +69,20 @@ eval %sh{kak-lsp --kakoune -s $kak_session} 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' + '' # LSP mappings + + + ""; }; xdg.configFile."kak-lsp/kak-lsp.toml".source =