gpt4 book ai didi

vim - nnoremap 和 inoremap 的区别

转载 作者:行者123 更新时间:2023-12-03 15:22:40 26 4
gpt4 key购买 nike

我的 .vimrc 中有以下几行。

 " Arrows are unvimlike 

nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>

我知道箭头键没有进行任何操作来强制使用 j、k、h、l。但是为什么有两组看起来相同的命令。或者换句话说,nnoremap 和 inoremap 之间有什么区别以及为什么它们都被使用。

最佳答案

您确保箭头键是 nop两者都适用 insertnormal模式

发件人:the Vim Wikia page :

n  Normal mode map. Defined using ':nmap' or ':nnoremap'.
i Insert mode map. Defined using ':imap' or ':inoremap'.

关于vim - nnoremap 和 inoremap 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22849386/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com