V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Goooogle
V2EX  ›  程序员

VIM 按键映射很奇怪的问题

  •  
  •   Goooogle ·
    n374 · 2014-04-03 14:31:57 +08:00 · 4519 次点击
    这是一个创建于 3647 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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
    10 条回复    1970-01-01 08:00:00 +08:00
    Pixeller
        1
    Pixeller  
       2014-04-03 14:55:46 +08:00
    看是不是有哪个插件或者终端的快捷键占用了, 简单的方法, 把.vim改名, 新开个.vimrc, 里面加上你那段, 如果还不能运行看是不是快捷键被占用.
    Goooogle
        2
    Goooogle  
    OP
       2014-04-03 15:34:30 +08:00 via Android
    @Pixeller 试过
    现有/无 .vim文件夹
    现有/只有四个映射/无 .vimrc
    共六种组合情况
    只有现有.vim文件夹+现有.vimrc文件情况下无法映射,手动输入映射命令有效
    其他所有情况即使手动输入都无法映射

    好奇怪
    henices
        3
    henices  
       2014-04-03 15:42:19 +08:00
    实在不行你就 ctrl-w ctrl-w 来回跳好了。
    darkbill
        4
    darkbill  
       2014-04-03 15:50:32 +08:00
    @Goooogle 那你看看,是不是现有的.vim/和.vimrc里面,有对这几个按键进行过映射定义。
    二分法查看吧。如果有需要。
    kran
        5
    kran  
       2014-04-03 15:54:07 +08:00
    :verbose map <c-h>
    Goooogle
        6
    Goooogle  
    OP
       2014-04-03 16:00:02 +08:00 via Android
    @kran no mapping found
    Goooogle
        7
    Goooogle  
    OP
       2014-04-03 16:08:50 +08:00 via Android
    @darkbill 试过unmap 提示no such mapping
    darkbill
        8
    darkbill  
       2014-04-03 16:26:07 +08:00
    @Goooogle 那么你在.vimrc里面,把这几行写进去,再看看?~
    Goooogle
        9
    Goooogle  
    OP
       2014-04-03 16:29:38 +08:00
    @darkbill 就在map下方unmap,还是提示no such mapping
    Goooogle
        10
    Goooogle  
    OP
       2014-04-03 17:09:05 +08:00
    原来imap jj <ESC>也可以的
    现在只会输入<ESC>了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   956 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 21:42 · PVG 05:42 · LAX 14:42 · JFK 17:42
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.