How do I map ctrl x ctrl o to ctrl space in terminal vim?

后端 未结 7 1032
时光说笑
时光说笑 2020-12-08 18:40

After searching a bit on the net it seems that I can\'t map CtrlSpace to anything/alot. Is there a way to do it today, what I found was usually 2 years

7条回答
  •  半阙折子戏
    2020-12-08 19:01

    The problem seems to be that Terminal.app doesn't interpret correctly and Vim understands it as which is a built-in mapping (:help CTRL-@).

    Maybe you could go with something like the following in your .vimrc:

    if !has("gui_running")
        inoremap  
    endif
    

    which seems to work, here, but I don't like the idea of overriding built-ins like that.

    Instead you should try with (:help leader), it gives you huge possibilities for defining your own custom mappings and (depending on the mapleader you choose) won't interfere with OS/app specific shortcuts/limitations and hence be more portable.

    With this in my .vimrc:

    let mapleader=","
    inoremap , 
    

    I just hit ,, to complete method names.

提交回复
热议问题