dab (which is a single command; you could also use da( or da) ) works
with the cursor anywhere between the ( and ) inclusive; if there are
nested parentheses it will delete the innermost () block containing the
cursor: example: (where ^ marks the cursor location and - what is
deleted; please view this in a fixed font)
aaa(bbb(ccc(ddd))efg)
--^---------------
-^--------
--^--
--------------^---
IIUC, when used with a count (i.e., d2ab d3ab etc.) it will delete that
many nested blocks containing the cursor.
To delete from the first ( to the last ) on a line you could use
:s/(.*)// but with no guarantee that those brackets will be matching
ones; or you could place your cursor on one of the brackets and use d%
to delete everything up to its mate (inclusive).
Best regards,
Tony.
--
The Soviet pre-eminence in chess can be traced to the average Russian's
readiness to brood obsessively over anything, even the arrangement of
some pieces of wood. Indeed, the Russians' predisposition for quiet
reflection followed by sudden preventive action explains why they led
the field for many years in both chess and ax murders. It is well
known that as early as 1970, the U.S.S.R., aware of what a defeat at
Reykjavik would do to national prestige, implemented a vigorous program
of preparation and incentive. Every day for an entire year, a team of
psychologists, chess analysts and coaches met with the top three
Russian grand masters and threatened them with a pointy stick. That
these tactics proved fruitless is now a part of chess history and a
further testament to the American way, which provides that if you want
something badly enough, you can always go to Iceland and get it from
the Russians.
-- Marshall Brickman, Playboy, April, 1973
In addition, there are other variants which I prefer to use to
explicitly tell vim that I want parens, instead of some generic
block, so I tend to almost exclusively use
i( or a(
i{ or a{
i[ or a[
instead of the "ib"/"ab" text objects. The combination of which
I use almost as much as just the
i" or a"
i' or a'
quotation text objects :)
-tim
In the whole file?
This could work if they're not nested and not split across lines:
:%s/(.{-})//
I.e. change an opening parenthesis followed by as little as possible to
get to the next closing parenthisis, into nothing.
If that's not good enough, but the right kind of direction, I'm sure
some wizards here can extend it.
Smiles,
Ben.