diff --git a/.config/kak/autoload/filetype/user-mode.kak b/.config/kak/autoload/filetype/user-mode.kak new file mode 100644 index 00000000..f607349f --- /dev/null +++ b/.config/kak/autoload/filetype/user-mode.kak @@ -0,0 +1,9 @@ +define-command -params 1 enter-filetype-mode %{ + try %{ + enter-user-mode %arg{1} + } catch %{ + fail No user mode set up for filetype %arg{1} + } +} + +map global normal "'" %{: enter-filetype-mode %opt{filetype}} diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak index 810c0e19..f541bfee 100644 --- a/.config/kak/autoload/lsp.kak +++ b/.config/kak/autoload/lsp.kak @@ -197,10 +197,10 @@ hook -group lsp-filetype-latex global BufSetOption filetype=latex %{ # printf %s "$kak_opt_lsp_servers" | kak -f "$(printf 'dictionary =s\\[.*\\]]_a, "%s"' "$kak_selection")" # } # } - declare-user-mode ltex - map -docstring 'ltex mode' buffer user L ': enter-user-mode ltex' - map -docstring 'PDF preview search' buffer ltex / ': texlab-forward-search' - map -docstring 'add selection to ltex dictionary' buffer ltex s ': ltex-add' + declare-user-mode latex + map -docstring 'PDF preview search' buffer latex / ': texlab-forward-search' + map -docstring 'add selection to ltex dictionary' buffer latex a ': ltex-dictionary-add' + map -docstring 'refresh ltex dictionary' buffer latex r ': ltex-dictionary-load' } remove-hooks global lsp-filetype-javascript