On 15/06/12 00:04, andy richer wrote:
Hi Vim Guru,
I know I can use % to find matching {} or [] or ()
Is there a way that if I click any of { , } , [ , ], ( , ) without
using %; gvim automatically highlight itself & its matching one?
example: if I click { then gvim highlight both { and }
Best regards,
Andy Richer
Normally if the cursor is on one of {}[]() its mate (if inside the
current window) is highlighted automatically; this is contingent on the
matchparen.vim plugin (which is normally installed as
$VIMRUNTIME/plugin/matchparen.vim)
Another possibility, with the cursor anywhere, would be to use visual
object selection: for instance
va{
would highlight the innermost block containing the cursor, from { to }.
With a count, highlight the n-th block counting the cursor, counting
from inside outwards. Similarly for va[ or va( (and it makes no
difference if you use closing brackets instead ;-) ). The same works
also for quotation marks: va" and va' select from the last quotation
mark before the cursor to the first one after the cursor, but only on
the current line; and (in all cases) with i instead of a you get the
"inner" contents i.e. without the boundary.
See
:help a(
:help i(
etc.
If the start and end markers you want to see are too far away from each
other to be visible at one time, I suppose you had better use %
Best regards,
Tony.
--
"To whoever finds this note -
I have been imprisoned by my father who wishes me to marry
against my will. Please please please please come and rescue me.
I am in the tall tower of Swamp Castle."
SIR LAUNCELOT's eyes light up with holy inspiration.
"Monty Python and the Holy Grail" PYTHON (MONTY)
PICTURES LTD
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php