[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: |
Wed, 16 Nov 2022 09:37:50 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 |
Op 15-11-2022 om 18:36 schreef Andreas Radke:
but both bindings fail when placing the cursor on the leading "md5sum"
not deleting md5sum but still removing the checksum itself and not the
word under cursor.
Yes, because those bindings were specific to your special case, for
deleting-the-thing-between-single-quotes, for when you do not want
to put 'set afterends' in your ~/.nanorc.
With *set afterends*, this will work fine for deleting the word under
the cursor:
bind ^D "{left}{nextword}{chopwordleft}" main
If you do not want to use 'set afterends', then a regular expression
will be needed to find end-of-word.
If you have *set regexp* in your ~/.nanorc, you can do:
bind ^D "{whereis}\b{enter}{chopwordleft}" main
But the cursor has to be really on the word, not before it or after it.
Without 'set regexp' in your ~/.nanorc, the binding will have to enable
it, temporarily, like this:
bind ^D "{whereis}{regexp}\b{enter}{whereis}{regexp}{cancel}{chopwordleft}"
main
Benno
OpenPGP_signature
Description: OpenPGP digital signature