简体   繁体   中英

Unable to have the reverse of Ctrl-O in Vim

I want to have the reverse of

  • Ctrl + O

to be

  • Shift + Ctrl + O

The original reverse is

  • Ctrl + I

How can you remap the reverse of CTRL + O in Vim to be Shift + CTRL + O ?

As shown in help under

:help C-o

the "reverse" of Ctrl + o is

Ctrl + i or Tab

Unfortunately Vim recognises Control-o and Control-O as synonyms.
There's some information here about why you can't map Control-Shift-o, but it doesn't look like it's possible.

I've upvoted Idigas answer, it's not that hard to remember Control-I.

Actually, if you use xterm , you can get around the terminal emulator limitations by remapping keys in your .Xresources file. Use a key sequence that you do not use anyway, for instance CM-7 (0x9f):

XTerm*vt100*translations: #override\n\
    Ctrl Shift <Key> O: string(0x9f)

Then do an xrdb -merge ~/.Xresources and map CM-7 to Ci in Vim.

Admittedly it's a hack, but it have helped me a lot. Check out my .Xresources for inspiration.

由于终端模拟器的限制, VimCtrl + Shift + O视为Ctrl + O.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM