How do I replace text using a custom Vimscript function in a substitution?
:%s/pattern/\=MyFunc(submatch(0))/g
The \= prefix in Vim's substitute replacement invokes the expression register, which can call any Vimscript function.
:%s/pattern/\=MyFunc(submatch(0))/g
The \= prefix in Vim's substitute replacement invokes the expression register, which can call any Vimscript function.
]] / [[
The ]] and [[ commands let you jump forward and backward between section boundaries, which in most programming languages correspond to function or method defini
navigation #navigation #motions #normal-mode #code #functions