Reputation: 110492
From the help on vim for Delete
:
c_<Del> c_Del
<Del> Delete the character under the cursor (at end of line:
character before the cursor) (see :fixdel if your <Del>
key does not do what you want).
Is it possible to disable this action: (at end of line: character before the cursor). If so, how could that be done?
Upvotes: 0
Views: 63
Reputation: 195229
If you are not happy with the default behavior, you can create a mapping to handle the "cursor at command EOL" case.
cnoremap <expr> <del> len(getcmdline())+1==getcmdpos()?'<left>' : '<del>'
Since you didn't tell what do you want the DEL to do when your cursor is at the EOL, I just used the left-arrow key as an example.
In this way, if the cursor is at EOL, you pressed DEL, cursor is gonna move back(left) one position without deleting anything. Otherwise, it does the normal delete function.
Upvotes: 1