[Top][All Lists]

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

Re: ctrl-w oddity on bash-4.4

From: Robert Elz
Subject: Re: ctrl-w oddity on bash-4.4
Date: Thu, 26 Oct 2017 11:21:07 +0700

    Date:        Wed, 25 Oct 2017 10:45:11 -0400
    From:        Chet Ramey <address@hidden>
    Message-ID:  <address@hidden>

  | If you read the discussion in the thread I pointed to last night, `real'
  | vi supposedly does this kind of thing. I'm not enough of a vi user to
  | say one way or the other.

In real vi, ^W (word kill) only works at all on text you have currently
typed in insert mode, there is no concept of moving somewhere, entering
insert mode, and then using ^W to delete backwards, that would be a
totally foreign concept to a vi user.

In command mode (in vi's new enough to support it) ^W relates to window
switching, and isn't related to line editing at all.

So, whatever is happening here, and why, no appeal to what real vi does
can possibly help.

In real vi, the way to delete backwards for text that previously existed,
and you have just moved to, would be to use the 'd' command in command
mode, and give it an address that expresses where you want to delete to.

For what was indicated here, the command would probably be "db".
That issued while sitting on the '=' in "true --foo=bar" deletes "foo".
That seems to work for me in bash-4,4 as well, and is the "correct vi"
method to use (not some "pretend to be like emacs" operator.)


reply via email to

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