w.brian
w.brian

Reputation: 17407

Cannot map <C-h>, and not sure why

I'm remapping <C-[hjkl]> to be used for navigating between window splits. <C-[jkl]> are all working as expected. <C-h> is not working, and I cannot figure out why.

Here is how I'm mapping them:

:nnoremap <C-h> <C-w>h
:nnoremap <C-j> <C-w>j
:nnoremap <C-k> <C-w>k
:nnoremap <C-l> <C-w>l

When I run verbose nnoremap <C-h> I see

n  <C-H>       * <C-W>h                                                                                                                                                                                                                       
        Last set from ~/.nvimrc

EDIT: Turns out this issue is specific to Neovim. If you come across this question and are working with vim, it won't apply to you.

Upvotes: 1

Views: 658

Answers (1)

ryuichiro
ryuichiro

Reputation: 3875

It is probably this issue. You can try following

Set kbs=\177 in your terminal's terminfo/termcap:

infocmp $TERM | sed 's/kbs=^[hH]/kbs=\\177/' > $TERM.ti
tic $TERM.ti

Source

Upvotes: 2

Related Questions