diff --git a/.config/kak/autoload/filetype/latex.kak b/.config/kak/autoload/filetype/latex.kak index 05dcbb5d..e2b2cbdc 100644 --- a/.config/kak/autoload/filetype/latex.kak +++ b/.config/kak/autoload/filetype/latex.kak @@ -1,17 +1,23 @@ # wrap selection in \emph{...} -define-command -override -params 1 latex-surround-add %~ +define-command -override -params 1 latex-surround-add-impl %~ evaluate-commands -save-regs 'a' -no-hooks %^ set-register a %arg{1} execute-keys -draft 'i\a{a}' ^ ~ -define-command -override -params 1 latex-surround-remove %~ +define-command -override -params 1 latex-surround-remove-impl %~ evaluate-commands -save-regs 'a"' -no-hooks %^ set-register a %arg{1} execute-keys -save-regs '"' -draft '\\ad{d' ^ ~ +define-command -override latex-surround-add %{ + prompt add: %{ + latex-surround-add-impl %val{text} + } +} + hook global WinSetOption filetype=latex %{ set-option window formatcmd "tex-fmt --stdin" set-option window autowrap_fmtcmd 'tex-fmt --stdin -l %c' @@ -24,9 +30,9 @@ hook global WinSetOption filetype=latex %{ remove-hooks window latex-auto-format } declare-filetype-mode latex - map window latex i ': latex-surround-add emph' - map window latex ': latex-surround-remove emph' - map window latex b ': latex-surround-add textbf' - map window latex ': latex-surround-remove textbf' + map window latex i ': latex-surround-add-impl emph' -docstring 'italicize selection' + map window latex ': latex-surround-remove-impl emph' -docstring 'deitalicize selection' + map window latex b ': latex-surround-add-impl textbf' -docstring 'bold selection' + map window latex ': latex-surround-remove-impl textbf' -docstring 'debold selection' } diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak index 7be5c61a..392cfbd4 100644 --- a/.config/kak/autoload/lsp.kak +++ b/.config/kak/autoload/lsp.kak @@ -277,8 +277,8 @@ hook -group lsp-filetype-latex global BufSetOption filetype=latex %{ declare-filetype-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' - map -docstring 'edit ltex dictionary' buffer latex e ': ltex-dictionary-edit' + map -docstring 'refresh ltex dictionary' buffer latex R ': ltex-dictionary-load' + map -docstring 'edit ltex dictionary' buffer latex E ': ltex-dictionary-edit' map -docstring 'texlab build' buffer latex B ': texlab-build' try lsp-progress-disable }