AutoYADM commit: 2025-06-23 18:40:15

This commit is contained in:
Daniel Fichtinger 2025-06-23 18:40:15 -04:00
parent 3455be367e
commit a84f8e259f
2 changed files with 14 additions and 8 deletions

View file

@ -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\<c-r>a{<esc>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 '<a-/>\\<c-r>a<ret>d<a-a>{<a-S>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<ret>'
map window latex <a-i> ': latex-surround-remove emph<ret>'
map window latex b ': latex-surround-add textbf<ret>'
map window latex <a-b> ': latex-surround-remove textbf<ret>'
map window latex i ': latex-surround-add-impl emph<ret>' -docstring 'italicize selection'
map window latex <a-i> ': latex-surround-remove-impl emph<ret>' -docstring 'deitalicize selection'
map window latex b ': latex-surround-add-impl textbf<ret>' -docstring 'bold selection'
map window latex <a-b> ': latex-surround-remove-impl textbf<ret>' -docstring 'debold selection'
}

View file

@ -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<ret>'
map -docstring 'add selection to ltex dictionary' buffer latex a ': ltex-dictionary-add<ret>'
map -docstring 'refresh ltex dictionary' buffer latex r ': ltex-dictionary-load<ret>'
map -docstring 'edit ltex dictionary' buffer latex e ': ltex-dictionary-edit<ret>'
map -docstring 'refresh ltex dictionary' buffer latex R ': ltex-dictionary-load<ret>'
map -docstring 'edit ltex dictionary' buffer latex E ': ltex-dictionary-edit<ret>'
map -docstring 'texlab build' buffer latex B ': texlab-build<ret>'
try lsp-progress-disable
}