2

我想在插入模式下映射以下导航

  • <c-h># 向左移动
  • <c-j># 向下移动
  • <c-k># 提升
  • <c-l># 向右移

因此,我将以下内容添加到我的.vimrc

inoremap <c-h> <left>
inoremap <c-j> <down>
inoremap <c-k> <up>
inoremap <c-l> <right>

现在,

  • 左边不起作用[而是删除左边的字符]
  • 正确的作品!
  • 起来工作!
  • 下来工作!

据我了解,<c-h>默认情况下deletes left character. 但我无法覆盖它。

我什至试过这个:

 inoremap <c-j> <down>
 inoremap <c-k> <up>
 inoremap <c-l> <right>
 " Re-mapping <c-h> for insert-mode
 autocmd InsertEnter call RemapCtrlH()
 function RemapCtrlH()
     iunmap <c-h>
     inoremap <c-h> <left>
 endfunction

但即使这样也没有用。

4

2 回答 2

2
于 2013-07-27T04:18:47.150 回答
1

我的解决方案:

inoremap <c-p> <up>
inoremap <c-n> <down>
inoremap <c-b> <left>
inoremap <c-f> <right>

优点:它们被广泛用于所有程序。

于 2014-03-03T08:59:59.163 回答