Re: button t useless?

2007-04-27 Thread Matthew Winn
On Thu, 26 Apr 2007 09:06:01 -0700 (PDT), Arun Easi [EMAIL PROTECTED]
wrote:

 In mapping. bdw cannot be used generically to delete the word under 
 cursor. Single letter objects is one case. Other one is when the cursor is 
 at the start of the word (I know you are talking when cursor is in the 
 middle). When you are doing the operation visually, I do not see much 
 advantage with one over the other.

dw deletes to the start of the next word, while diw deletes the word
but leaves any space beyond it intact. In most cases I find I want to
remove a word completely, including pulling the next word over to the
cursor, so dw is better for me. Starting from the middle of a word,
it's a choice of bdw or diwdw.

-- 
Matthew Winn


Re: button t useless?

2007-04-27 Thread Arun Easi

On Fri, 27 Apr 2007, Matthew Winn wrote:


On Thu, 26 Apr 2007 09:06:01 -0700 (PDT), Arun Easi [EMAIL PROTECTED]
wrote:


In mapping. bdw cannot be used generically to delete the word under
cursor. Single letter objects is one case. Other one is when the cursor is
at the start of the word (I know you are talking when cursor is in the
middle). When you are doing the operation visually, I do not see much
advantage with one over the other.


dw deletes to the start of the next word, while diw deletes the word
but leaves any space beyond it intact. In most cases I find I want to
remove a word completely, including pulling the next word over to the
cursor, so dw is better for me. Starting from the middle of a word,
it's a choice of bdw or diwdw.



daw would do what you want. Actually there is a whole bunch of deletions 
under help daw, most of which I never use, maybe because I dont remember 
it when editing. I mostly delete using dw or dfchar followed by .


Re: button t useless?

2007-04-27 Thread A.J.Mechelynck

Matthew Winn wrote:

On Thu, 26 Apr 2007 09:06:01 -0700 (PDT), Arun Easi [EMAIL PROTECTED]
wrote:

In mapping. bdw cannot be used generically to delete the word under 
cursor. Single letter objects is one case. Other one is when the cursor is 
at the start of the word (I know you are talking when cursor is in the 
middle). When you are doing the operation visually, I do not see much 
advantage with one over the other.


dw deletes to the start of the next word, while diw deletes the word
but leaves any space beyond it intact. In most cases I find I want to
remove a word completely, including pulling the next word over to the
cursor, so dw is better for me. Starting from the middle of a word,
it's a choice of bdw or diwdw.



To delete the current word including the space on one side, use daw (Delete A 
Word).



Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
203. You're an active member of more than 20 newsgroups.


RE: button t useless?

2007-04-27 Thread Halim, Salman
 I'm a one-handed typist (right-handed), and to me both are 
 about equally bad on ergonomical grounds. I don't think of 
 what I do as pecking however: I know where the keys are on 
 my AZERTY keyboard, and I use all five fingers of my right 
 hand, which is not riveted to a constant location over the
 keyboard: this makes for reasonably fast typing, maybe 
 faster that some of you decadactylographers ;-) .
 
 I go with the previous argument however: bdw has the 
 inconvenient of including a prepare step:
 
 bdw   (move);(delete(word))
 diw   (delete((inner)word))
 
 
 In my mental model, bdw is two steps, diw is one.
 
 
 Best regards,
 Tony.

Tony,

I had indeed not considered those who either typed with one hand or used
a non-QWERTY keyboard.  In retrospect, if I were typing with one hand, I
think I would prefer bdw to diw simply because the keys for it are close
together, allowing for faster entry.

Bdw is definitely two steps, both mentally and in actuality.  As someone
else pointed out, you can repeat diw with a ., but not bdw, as it is not
atomic.

Regards,

Salman.


Re: button t useless?

2007-04-27 Thread A.J.Mechelynck

Halim, Salman wrote:
I'm a one-handed typist (right-handed), and to me both are 
about equally bad on ergonomical grounds. I don't think of 
what I do as pecking however: I know where the keys are on 
my AZERTY keyboard, and I use all five fingers of my right 
hand, which is not riveted to a constant location over the
keyboard: this makes for reasonably fast typing, maybe 
faster that some of you decadactylographers ;-) .


I go with the previous argument however: bdw has the 
inconvenient of including a prepare step:


bdw (move);(delete(word))
diw (delete((inner)word))


In my mental model, bdw is two steps, diw is one.


Best regards,
Tony.


Tony,

I had indeed not considered those who either typed with one hand or used
a non-QWERTY keyboard.  In retrospect, if I were typing with one hand, I
think I would prefer bdw to diw simply because the keys for it are close
together, allowing for faster entry.

Bdw is definitely two steps, both mentally and in actuality.  As someone
else pointed out, you can repeat diw with a ., but not bdw, as it is not
atomic.

Regards,

Salman.




AZERTY is not very different from QWERTY: it swaps A with Q, Z with W, moves 
the M to the right of the L, the digits to uppercase, and only the punctuation 
really moves wildly (and differently in fr_BE [mine] than in fr_FR). (What I 
wouldn't want is to have to use a Dvorak keyboard or one of those newfangled 
two-part Microsoft keyboards which practically /require/ both-hands typing.)


For bdw I hit b, then I have to go still further away left to get dw. For diw, 
I hit d with my right index, i with my right little finger, and there isn't 
that much of a displacement to get at the w (which is where your z is). Of 
course it may be different for real hunter-pecker monodactylographers.



Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
206. You religiously respond immediately to e-mail, while ignoring
 your growing pile of snail mail.


Re: button t useless?

2007-04-27 Thread Sartak

On 4/26/07, A.J.Mechelynck [EMAIL PROTECTED] wrote:

I go with the previous argument however: bdw has the inconvenient of including
a prepare step:

bdw (move);(delete(word))
diw (delete((inner)word))


In my mental model, bdw is two steps, diw is one.


Not to mention that the repeat-command command . ignores motions
before the operator you use. So diw is .able but bdw isn't.

Shawn M Moore

P.S. Tony: sorry for sending this to you twice.. I need to configure
gmail to reply to all automatically -_-


Re: button t useless?

2007-04-26 Thread zzapper
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?


-- 
zzapper
http://www.rayninfo.co.uk/vimtips.html



Re: button t useless?

2007-04-26 Thread Michael Dunn

On 25/04/07, Erlend Hamberg [EMAIL PROTECTED] wrote:

On Wednesday 25 April 2007 09:01:49 alebo wrote:
 Whats the reason vim has the function t
 which does the same as f, only moving to the character
 before? It seems useless to me; you can use f insted
 of t always, or...?

If you want to change or delete text to a certain character it would be
annoying to use f, as you then would have to retype that character. ;-)


Brilliant! I didn't know about t before (thanks, alebo). I always need
this in python, where _ is a word character, but you sometimes want to
treat it as a word boundary. For example, suppose you have the cursor
over o in the following:

reactor.vent_radioactive_gas()

ciw will replace the entire method vent_radioactive_gas
But T_ct_ will replace just radioactive

Cheers, Michael


Re: button t useless?

2007-04-26 Thread Tim Chase

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?


I think it's the mental model.

diw is two mental steps:  {action}{object} where {action} is 
delete and {object} is iw even though that {object} is two 
characters.


bdw, OTOH, has a 3-step mental model of 
{prepare}{action}{motion} where you {prepare} with b, {action} 
with d over {motion} with w.


When vimming, you begin to think in the flow okay...I want to 
delete something [hit 'd'] and it's this thing [provide 
object/motion].  The latter intrudes on this by requiring you to 
not start your deletion action until you've prepared for it.


Or maybe that's just the warped way my own mind works :)

-tim




RE: button t useless?

2007-04-26 Thread Halim, Salman
This might not be a huge deal, but bdw is typed entirely with the left
hand if you're on a QWERTY keyboard (most people with English/US
keyboards) while diw switches hands.  Unless you're pecking at the
keys with one hand, diw is simply much faster to type :)

Salman.

 -Original Message-
 From: Tim Chase [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, April 26, 2007 9:48 AM
 To: zzapper
 Cc: vim@vim.org
 Subject: Re: button t useless?
 
  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?
 
 I think it's the mental model.
 
 diw is two mental steps:  {action}{object} where {action} 
 is delete and {object} is iw even though that {object} is 
 two characters.
 
 bdw, OTOH, has a 3-step mental model of 
 {prepare}{action}{motion} where you {prepare} with b, 
 {action} with d over {motion} with w.
 
 When vimming, you begin to think in the flow okay...I want 
 to delete something [hit 'd'] and it's this thing [provide 
 object/motion].  The latter intrudes on this by requiring 
 you to not start your deletion action until you've prepared for it.
 
 Or maybe that's just the warped way my own mind works :)
 
 -tim
 
 
 


Re: button t useless?

2007-04-26 Thread Yegappan Lakshmanan

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


Re: button t useless?

2007-04-26 Thread fREW

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


Re: button t useless?

2007-04-26 Thread A.J.Mechelynck

Halim, Salman wrote:

This might not be a huge deal, but bdw is typed entirely with the left
hand if you're on a QWERTY keyboard (most people with English/US
keyboards) while diw switches hands.  Unless you're pecking at the
keys with one hand, diw is simply much faster to type :)

Salman.

[...]

I'm a one-handed typist (right-handed), and to me both are about equally bad 
on ergonomical grounds. I don't think of what I do as pecking however: I 
know where the keys are on my AZERTY keyboard, and I use all five fingers of 
my right hand, which is not riveted to a constant location over the 
keyboard: this makes for reasonably fast typing, maybe faster that some of 
you decadactylographers ;-) .


I go with the previous argument however: bdw has the inconvenient of including 
a prepare step:


bdw (move);(delete(word))
diw (delete((inner)word))


In my mental model, bdw is two steps, diw is one.


Best regards,
Tony.


Re: button t useless?

2007-04-25 Thread Erlend Hamberg
On Wednesday 25 April 2007 09:01:49 alebo wrote:
 Whats the reason vim has the function t
 which does the same as f, only moving to the character
 before? It seems useless to me; you can use f insted
 of t always, or...?

If you want to change or delete text to a certain character it would be 
annoying to use f, as you then would have to retype that character. ;-)

I use the t motion all the time. :-)

-- 
Erlend Hamberg
[EMAIL PROTECTED]


Re: button t useless?

2007-04-25 Thread list
technically and logically you are correct, however the human has an 
objective mind and required f AND t, also don't forget F AND T to move 
backwards.


this in the case where a space may occur or not occur before a ( or 
other punctuation. you know the punctuation but without t/T you have to 
carefully examine the character before.


try to use it a few times a day, see if it works for you?

Erlend Hamberg wrote:

On Wednesday 25 April 2007 09:01:49 alebo wrote:

Whats the reason vim has the function t
which does the same as f, only moving to the character
before? It seems useless to me; you can use f insted
of t always, or...?


If you want to change or delete text to a certain character it would be 
annoying to use f, as you then would have to retype that character. ;-)


I use the t motion all the time. :-)





Re: button t useless?

2007-04-25 Thread Karl Guertin

On 4/25/07, alebo [EMAIL PROTECTED] wrote:

Whats the reason vim has the function t
which does the same as f, only moving to the character
before? It seems useless to me; you can use f insted
of t always, or...?


I was using t (specifically ct) for years before I discovered f and
still tend to use it more often.