help-nano
[Top][All Lists]
Advanced

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

Re: how to delete a full word with cursor in the middle of the word?


From: Benno Schulenberg
Subject: Re: how to delete a full word with cursor in the middle of the word?
Date: Tue, 15 Nov 2022 18:03:31 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2


Hello Andy,

Op 15-11-2022 om 13:25 schreef Andreas Radke:
1) I'm missing a simple one keystroke function to delete a full word in
nano under the cursor to both ends with a single (key) action?

With the new nano-7.0 you could do something like:

  set afterends
  bind ^D "{left}{nextword}{chopwordleft}" main

The {left} is not strictly necessary but will make the keystroke work
also when the cursor is just after the word, which is what Ctrl+Right
will do when --afterends is active.

2) And I have a special case where word boundaries don't work properly
for me: I haven't found a simple way to delete quoted sha checksums
with one keystroke keeping the quotes like:
'b2059568b1e35c34c12b580803998e66b142d96e9a35f16b63afccb8e6af5c34'

The example given above would work here too.  But if you don't want
to use --afterends, you could make a binding specific for this case:

  bind ^D "{end}{left}{chopwordleft}" main

If the closing quote is not guaranteed to be at end-of-line, something
a little more complicated could work:

  bind ^D "{home}{whereis}'{enter}{findnext}{chopwordleft}" main


Benno

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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