I want pressing backspace to result in:
For references
doing just x or just dl produces
and dh gives
I want pressing backspace to result in:
For references
doing just x or just dl produces
and dh gives
Add the following to your .vimrc
:
nnoremap <BS> x
This adds a non-recursive mapping to normal mode, where <BS>
now performs x
.
If you just want to test this mapping without adding it to your .vimrc
, enter command mode with :
, type in the line above, then hit enter.
you can map <BS>
to do x
and then h
:
nnoremap <BS> xh
This should be what you are looking for.
nnoremap <expr> <BS> col('.')==(col('$')-1)?'x':'xh'