commit 5f5afb586c78452c11fe31d615f31b595f93fced parent 0db7f31f6d9f41bb7cae9793a272770469c79dcc Author: Alex Balgavy <alex@balgavy.eu> Date: Tue, 2 Aug 2022 20:34:02 +0200 vim: snippets & surround for latex Diffstat:
M | vim/after/ftplugin/tex.vim | | | 7 | ++++++- |
M | vim/ultisnips/tex.snippets | | | 4 | ++++ |
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/vim/after/ftplugin/tex.vim b/vim/after/ftplugin/tex.vim @@ -16,7 +16,12 @@ setlocal foldmethod=indent setlocal foldexpr=vimtex#fold#level(v:lnum) setlocal foldtext=vimtex#fold#text() setlocal expandtab + +" Set up surround +if exists('g:loaded_surround') + let b:surround_99 = "\\\1command: \1{\r}" +endif let b:undo_ftplugin = (exists('b:undo_ftplugin') ? b:undo_ftplugin.'|' : '') let b:undo_ftplugin .= 'nmapc <buffer>' let b:undo_ftplugin .= '|imapc <buffer>' -let b:undo_ftplugin .= '|setlocal formatoptions< wrap< foldmethod< foldexpr< foldtext<' +let b:undo_ftplugin .= '|setlocal formatoptions< wrap< foldmethod< foldexpr< foldtext< expandtab<' diff --git a/vim/ultisnips/tex.snippets b/vim/ultisnips/tex.snippets @@ -222,6 +222,10 @@ snippet b "bold text" w \textbf{$1} endsnippet +snippet sc "small caps" w +\textsc{$1} +endsnippet + snippet pre "preformatted text" w \texttt{$1} endsnippet