Reputation: 61
I played around with tmux config. I love tmux and I don't want to stop using it, but for some reason the delete key doesn't delete anymore. It deletes a character and works normally in vim, but not in vim when opened from tmux. Backspace works fine. Just the delete key stopped working only in vim running on tmux. Any ideas?
Upvotes: 1
Views: 1652
Reputation: 56657
You may need to remap the delete key in your .vimrc. For instance, like this:
inoremap ^? <c-h>
cnoremap ^? <c-h>
" Debian-specific variation
inoremap <esc>[3~ <c-h>
cnoremap <esc>[3~ <c-h>
I have both of these in my .vimrc, and have for years, and it's worked everywhere for me. With or without tmux.
I will note though that the ^?
in the first two lines is NOT the characters ^
and ?
, it is a single embedded delete character. The way to insert this is to edit your .vimrc with vim, and use this sequence to insert it:
Press CtrlV, then press Delete.
If done properly, Vim should show it to you as a ^?
, but it is a single character in the file. The rest of the lines are typed exactly as they are shown.
This will remap the delete key to send backspace, and you can use them interchangeably.
Upvotes: 2