reedline icon indicating copy to clipboard operation
reedline copied to clipboard

No difference between "cutwordleft" and "cutbigwordleft"

Open ineu opened this issue 2 years ago • 1 comments

From the discussion: https://github.com/nushell/nushell/discussions/8859

I'm trying to remove the last part of the long_token_separated_by_underscores. For this purpose I tried binding the actions in question:

    {
      name:     delete_word
      modifier: control
      keycode:  char_g
      mode:     emacs
      event:    { edit: cutwordleft }
    }

The same for cutbigwordleft.

Expected result:

  • cutwordleft removes text to the previous underscore and/or a capital letter
  • cutbigwordleft removes the whole token

Actual result:

  • both behave the same and remove the whole token

ineu avatar Apr 13 '23 07:04 ineu

Underscores (U+005F/"Low line") are considered part of a word according to the Unicode recommendations and the default behavior of vim, thus we followed that precedent.

I agree that with longer identifiers that can feel a bit excessive, which is why bash's readline and according to your discussion also zle seem to follow a different pattern.

I think for vi mode we should still follow the convention that a valid identifier is a word but I think we would welcome an additional move/cut/delete set for the more granular word definition.

sholderbach avatar Apr 14 '23 15:04 sholderbach