From 2d16cd8da448282a6c71efcf878223a0c2ea89db Mon Sep 17 00:00:00 2001 From: Bruno Thiago Date: Mon, 9 Sep 2024 16:01:58 -0300 Subject: [PATCH] feat: latext macro --- plugin/surround.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugin/surround.vim b/plugin/surround.vim index 8a4016e..2c4a15a 100644 --- a/plugin/surround.vim +++ b/plugin/surround.vim @@ -231,6 +231,17 @@ function! s:wrap(string,char,type,removed,special) let after = ' ' . after endif endif + elseif newchar ==# 'm' || newchar ==# 'M' + let fnc = input('macro: ') + if fnc != "" + let s:input = fnc."\" + let before = substitute(fnc,'{$','','').'{' + let after = '}' + if newchar ==# 'M' + let before .= ' ' + let after = ' ' . after + endif + endif elseif newchar ==# "\" let fnc = input('function: ') let s:input = fnc."\"