Please help me find a way to move to the matching char pair from within a :source'd script...
Something like the Command mode move to matching paren/brace/bracket/angles... using the '%' key... but from the :source'd script...
Tim Chase mentions in another article (reference below) using % to move to the matching in normal mode. The CTRL-O in insert mode was interesting as well...
I'm trying to use a "move to matching" inside a :source'd script. Is there a way to still move to matching brace after finding the start brace inside the :source'd script?
more info....
I tried a line with a single percent '%' and it moves the cursor to the end of the file. So I always got from the starting point to the end of the file and not the matching brace.
After reading Tim's response, I also tried something like this after finding the starting brace. Here I am typing out the characters representing the characters i, CTRL-o, %, escape key, where CTRL-o and escape were entered using the escaping key mech of CTRL-V (linux):
i^O%^[
thanks for looking and thanks in advance for the help... newbie...
Jim
=================================
Subject: How to move cursor in insert mode?
Credit: Tim Chase
Some gross movements (such as by word or screen) can be done in
insert-mode as well (control+left/right, home/end, pgup/dn)
though some may be limited to gvim. For some of the other
vim-specific movements, you can also use control+o ("oh", not
"zero") to temporarily enter normal mode to issue one normal-mode
command such as "%" to move to the matching paren/brace/bracket
or ")" to move to the next sentence. All your typical motions
should work here.
:help i_CTRL-O
:help motion.txt
-tim