Question

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?

Was it helpful?

Solution

As shown in help under

:help C-o

the "reverse" of Ctrl+o is

Ctrl+i or Tab

OTHER TIPS

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 C-M-7 (0x9f):

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

Then do an xrdb -merge ~/.Xresources and map C-M-7 to C-i in Vim.

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

Vim sees Ctrl+Shift+O as Ctrl+O because of a limitation with terminal emulators.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top