On 4/26/07, Yegappan Lakshmanan <[EMAIL PROTECTED]> wrote:
Hi,

On 4/26/07, zzapper <[EMAIL PROTECTED]> wrote:
> zzapper <[EMAIL PROTECTED]> wrote in
> news:[EMAIL PROTECTED]:
>
> > alebo <[EMAIL PROTECTED]> wrote in
> > news:[EMAIL PROTECTED]:
> >
> >>
> > In fact VIM has many features that appear redundant but then one day
> > (perhaps after many years) you realise their utility.
> >
> In fact I've found that there is usually (always?) a subtle advantage in
> using one or other of a command which apparently does the same thing, and
> that in different circumstances one or the other will be superior.
>
> eg
>
> When the cursor is in the middle of a word you wish to delete
>
> diw has a distinct advantage over bdw
>
> But what is it?
>

The bdw command can be used to delete the current word only when
the cursor is in the middle of the word. Also, this command cannot be
used to delete single letter words. You have to then use 'x' to delete
single letter words, 'dw' when the cursor is at the start of a word
and 'bdw' when the cursor is not at the start of the word.

The diw command can be used to delete the current word irrespective
of the cursor position in the word and also to delete single letter
words. This is particularly useful from a map command.

- Yegappan


The subject may have been beaten to death by now, but one thing that
happens to me a lot that proves the usefulness of t is this:

Say you have the following line of text:

Computer.open_close(cdrom)

if your cursor is on the o and you want to delete till the (, dt( will
do the trick, whereas dfe will not unless you do it twice.  Honestly,
I use t more because it fits my mental model better, like tim was
talking about.

-fREW

Reply via email to