help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] vim mode changes


From: Chadwick Rogers
Subject: Re: [Help-bash] vim mode changes
Date: Fri, 11 Aug 2017 09:10:58 -0400

Thanks for the reply.  Perhaps my description is wrong.  The behaviour I
describe only happens when inputrc has in editing-mode vi, and the
behaviour seems to have changed in a recent version.

On Fri, Aug 11, 2017 at 8:14 AM, Greg Wooledge <address@hidden> wrote:

> On Thu, Aug 10, 2017 at 11:25:53PM -0400, Chadwick Rogers wrote:
> > But my scenario is slightly different.  Run bash in vi-mode, type "echo
> > hello world", press enter, press up arrow on your keyboard, press the
> home
> > key to jump to the beginning of the line followed by the right arrow to
> the
> > end of 'hello' or press the left arrow to the end of 'hello', press
> ctrl+w,
> > the word will not delete.
>
> Those just are not vi editing commands or paradigms.  Those are emacs
> editing paradigms.  You haven't even hit Esc at any point to switch
> to command mode, let alone used a vi command like "dw" to delete a
> word.
>
> Here's how it works in vi mode, using vi editing paradigms:
>
> echo hello world (Enter)
> Esc k   # now you are on the previous command, at start of line
> w       # now you are at the start of "hello".  Shift-W would also work.
> dw      # delete the word "hello".  dW would also work.
> Enter   # execute the command
>
> Note the difference between "w" words and "W" Words.  The latter includes
> all non-whitespace characters, while the former stops at many of the
> punctuation characters.
>
> The only time Ctrl-w does anything in vi mode is when you're typing
> merrily along in insert/append mode, and you realize that you have
> seriously mangled the previous word, to the point where you feel it
> would be quicker to nuke the entire word and retype it, than to
> backspace and correct it.  So you press Ctrl-w while you are still
> in insert/append mode, and it acts like "pressing backspace a whole
> bunch of times".  Then you can retype that word.
>
> You don't use Ctrl-w after entering command mode and moving the cursor.
>
> Don't believe me?  Go into an actual vi or vi-clone editor and try
> it out.  Open a file with some text in it.  Go to the end of a line
> with multiple words.  Press Ctrl-w.  Nothing happens!  Nothing is
> supposed to happen.  Ctrl-w is not a command-mode command.  It's
> cribbed from the "werase" feature of the terminal driver, and only
> applies to insert/append mode.
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]