I am writing a vim function to insert some text in a c++ file, please see the following function:
function! InsertDebugInfo()
let i = line('.')
call append(i+1, '#ifdef DEBUG')
call append(i+2, 'std::cout << "" << std::endl;')
call append(i+3, '#endif')
call append(i+4, '')
call cursor(i+3, 0)
endfunction
In normal mode, I use ==
to re-indent one code line. My question is
how to call ==
in the above function. Furthermore, how to execute the
command such as 2f"
which move the cursor to the second "
.