5

This can be done with either regex+substitute or macros Substitute. This is the same as your regex except the important parts are surrounded by \( . \) to create capture groups. These are referred to by submatch(1) and submatch(2) respectively. We use the replace expression \= and execute('let') idiom. Finally, use /n to prevent substitution from ...


2

Define a list of all the lines you want to insert, and then insert them with either append() or setline(). You'll also need to extract the current indentation. See: :h List :h setline() :h append() :h indent() PS: half a year is almost the time we spent on validating our snippet plugins...


2

Use :execute to assemble a command from a string, which allows you to include the contents of a variable or return value from a function. This should work: function! WinRight() let ypos=getwinposy() execute "winpos 1241 ".ypos endfunction Or even: function! WinRight() execute "winpos 1241 ".getwinposy() endfunction


1

the system I am working on, its very very difficult if not impossible to get pluggins so I have to do stuff through my vimrc or other method. Basically trying to get a plugin installed could take half a year. Please note that you don't need to install plug-ins system wide and they can live completely inside your home directory (under ~/.vim more exactly. A ...


1

There are two <para> because you apply v:count1 to every tag you render. Try this: function s:DocbkPrintTag(tag) " apply v:count1 to the outside tag put =repeat(s:DocbkRenderTag(a:tag), v:count1) endfunction function s:DocbkRenderTag(tag) ... " render single tag here if !empty(include) for incl_tag in include let incl_result .= ...


Only top voted, non community-wiki answers of a minimum length are eligible