Is there a way to use the alt+backspace
in vim command line? It gets unruly when having to backspace /very/long/file/path
individually instead of using alt+backspace to delete by words.
try using instead <c-w>
(that is ctrl+w) to erase words or <c-u>
(ctrl+u) to delete lines.
http://vim.wikia.com/wiki/Map_Ctrl-Backspace_to_delete_previous_word
:imap <C-BS> <C-W>
sets ctrl backspace, i have to look at how to do alt
If you are at the end of the path you can hit B
followed by a dW
(case matters). This will jump you to the beginning of the word (ignoring the slashes) and subsequently delete the word (again ignoring the slashes).
Hope this helps.
Vim is unable to receive alt input. skeept's answer seems to be the best alternative.
See this answer:
The Alt/Meta key is problematic in Vim and most terminals, see this answer of mine for an overview of the situation (the situation is the same for Meta and Alt).
In short, Vim doesn't receive Alt at all: hitting Alt+Backspace is exactly the same as hitting Backspace.
Anyway, it will be better for you in the long term to learn and get accustomed to Vim's default key-mappings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With