feedforward icon indicating copy to clipboard operation
feedforward copied to clipboard

kill whole line shortcut

Open ndr-brt opened this issue 4 years ago • 4 comments

Would be useful to define a shortcut to kill all the line where the cursor is. At the moment there's the kill-line (C-k), but it requires to many digits to accomplish the task.

The keybind could be C-S-k.

ndr-brt avatar Jan 19 '21 12:01 ndr-brt

Hmm but C-k only requires two keys whereas C-S-k requires three?

yaxu avatar Jan 20 '21 16:01 yaxu

Yes, but C-k kills a line from the cursor to the end of the line (\n excluded), I wanted a command like the dd in VI, where the current line is deleted completely (\n included)

I did some researches/explorations about that and I learned that:

  • The emacs keybind for kill-whole-line seems to be C-S-Backspace, not C-S-k
  • It's not that easy to catch C-S events on ncurses (as you said in #22 )

Enabling logs, I noticed that the C-S-Backspace combination generates an EventCharacter '\b', that's generated also with C-Backspace, so maybe that could be our shortcut to remove a line.

ndr-brt avatar Jan 21 '21 10:01 ndr-brt

Other information, C-S-Backspace, C-Backspace and C-h launch the same event (ord == 8)

ndr-brt avatar Jan 21 '21 11:01 ndr-brt

FWIW, I use ctrl-a ctrl-k for this

yaxu avatar Feb 18 '21 09:02 yaxu