当我通过命令缓冲区创建以下键映射时,它按预期工作,将光标向下移动5行:
map ^[[1;3B 5<Down>
当我将它添加到我的.vimrc文件以便它可以跨会话时,按Alt +向下移动1行(到不在垂直上方的某个地方 - 也许它会转到上一个句子)。我的:地图输出是这样的:
0 ^
^[[1;3B 5<Down>
n gx <Plug>NetrwBrowseX
n <Plug>NetrwBrowseX * :call netrw#NetrwBrowseX(expand("<cWORD>"),0)<CR>
Press ENTER or type command to continue
为什么这个vimrc映射的工作方式与我在命令缓冲区中输入的内容类似?
我的vim版本是:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 10 2014 00:22:49)
Included patches: 1-135
Compiled by <cygwin@cygwin.com>
更新
有两个问题。
map <M-Down> 5<Down>
但理解map <M-Down> 5j
map <M-Down> 5j
工作。我必须在我的Cygwin环境中放入一堆黑客来获得“正常”的vim行为:"================== " Keyboard trouble "================= " Every so often I am using a system that inserts a A, B, C, or D " when using the arrow keys within the Vim editors insert mode. " Vim is for VI Improved. While I did not dig into the exact reasons " as to why (terminal emulation?) it happens, it is quite annoying. set nocompatible "set term=cons25 " This fixes Cygwin's vim's page up, home, end etc. keys " http://superuser.com/questions/480215/ " how-to-map-pagedown-and-pageup-keys-to-function-normally set term=mintty set backspace=2 " backspace on Cygwin Windows Objy was not deleting properly. " But this doesn't solve other cursor movements like "home and end "source /home/sarnobat/.vim/cscope_maps.vim "g:CCTreeCscopeDb = "/home/sarnobat/cscope/cscope.files" "============================== " Key bindings "============================== map 0 ^
答案 0 :(得分:0)
答案 1 :(得分:0)
你可以尝试以下方法:
map <M-down> 5j
在cygwin上尝试过它并且有效。 hjkl是向左,向下,向上和向右导航的首选方法。