VIM 按键映射很奇怪的问题

2014-04-03 14:31:57 +08:00
 Goooogle
map <C-H> <C-W>h
map <C-J> <C-W>j
map <C-K> <C-W>k
map <C-L> <C-W>l
vimrc中这四行是映射窗口跳转的,不知道为什么在就是不能用
手动输入命令可用,复制到vps上可用


VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 10 2013 21:13:24)
Included patches: 1-113
Compiled by nerd@Ubuntu
Huge version with GTK2 GUI. Features included (+) or not (-):
+acl +farsi +mouse_netterm +syntax
+arabic +file_in_path +mouse_sgr +tag_binary
+autocmd +find_in_path -mouse_sysmouse +tag_old_static
+balloon_eval +float +mouse_urxvt -tag_any_white
+browse +folding +mouse_xterm -tcl
++builtin_terms -footer +multi_byte +terminfo
+byte_offset +fork() +multi_lang +termresponse
+cindent +gettext -mzscheme +textobjects
+clientserver -hangul_input +netbeans_intg +title
+clipboard +iconv +path_extra +toolbar
+cmdline_compl +insert_expand -perl +user_commands
+cmdline_hist +jumplist +persistent_undo +vertsplit
+cmdline_info +keymap +postscript +virtualedit
+comments +langmap +printer +visual
+conceal +libcall +profile +visualextra
+cryptv +linebreak +python +viminfo
+cscope +lispindent -python3 +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con_gui -lua +rightleft +windows
+diff +menu +ruby +writebackup
+digraphs +mksession +scrollbind +X11
+dnd +modify_fname +signs -xfontset
-ebcdic +mouse +smartindent +xim
+emacs_tags +mouseshape -sniff +xsmp_interact
+eval +mouse_dec +startuptime +xterm_clipboard
+ex_extra -mouse_gpm +statusline -xterm_save
+extra_search -mouse_jsbterm -sun_workshop +xpm
4560 次点击
所在节点    程序员
10 条回复
Pixeller
2014-04-03 14:55:46 +08:00
看是不是有哪个插件或者终端的快捷键占用了, 简单的方法, 把.vim改名, 新开个.vimrc, 里面加上你那段, 如果还不能运行看是不是快捷键被占用.
Goooogle
2014-04-03 15:34:30 +08:00
@Pixeller 试过
现有/无 .vim文件夹
现有/只有四个映射/无 .vimrc
共六种组合情况
只有现有.vim文件夹+现有.vimrc文件情况下无法映射,手动输入映射命令有效
其他所有情况即使手动输入都无法映射

好奇怪
henices
2014-04-03 15:42:19 +08:00
实在不行你就 ctrl-w ctrl-w 来回跳好了。
darkbill
2014-04-03 15:50:32 +08:00
@Goooogle 那你看看,是不是现有的.vim/和.vimrc里面,有对这几个按键进行过映射定义。
二分法查看吧。如果有需要。
kran
2014-04-03 15:54:07 +08:00
:verbose map <c-h>
Goooogle
2014-04-03 16:00:02 +08:00
@kran no mapping found
Goooogle
2014-04-03 16:08:50 +08:00
@darkbill 试过unmap 提示no such mapping
darkbill
2014-04-03 16:26:07 +08:00
@Goooogle 那么你在.vimrc里面,把这几行写进去,再看看?~
Goooogle
2014-04-03 16:29:38 +08:00
@darkbill 就在map下方unmap,还是提示no such mapping
Goooogle
2014-04-03 17:09:05 +08:00
原来imap jj <ESC>也可以的
现在只会输入<ESC>了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/107109

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX