I was reading the a vim tips page and stumbled across <C-O>. How do I enter that on my keyboard? (I'm on a mac)
Asked
Active
Viewed 6,176 times
0
kilojoules
- 630
- 1
- 7
- 15
2 Answers
3
In Vim (and Emacs) documentation, C- and M- stand for Ctrl and Meta (i.e. Alt) respectively. So C-O is CtrlO.
u1686_grawity
- 426,297
- 64
- 894
- 966
0
In documentation C- refers to the Control key Ctrl on a PC, or the Command key ⌘ on a Mac. It is pressed and held while the key after the C- is pressed, in your case ⌘ + O.
AFH
- 17,300
- 3
- 32
- 48
-
Most terminal applications inherited from the greater Unix-like world use the Control key on the Mac as well, not the Command key. This includes Vim. MacVim (the thirdparty build that provides a gui and is generally more up to date than the Vim that Apple provides built-in), does *add* some shortcuts that use the Command key, but it does not change standard Vim commands from Control to Command. – 8bittree Apr 05 '17 at 19:45
-
Vim actually has specific syntax for the Command key: `
`. This isn't MacVim specific, I've verified its presence in `:help key-notation` in Vim on Cygwin and native Windows. – 8bittree Apr 05 '17 at 20:24 -
@8bittree - The Macs I've worked with didn't have a Control key and needed to use the Command key instead. Maybe the latest Macs have both, in which case thanks for the information. – AFH Apr 05 '17 at 21:14
-
Well now I'm curious what Macs you've been using that didn't have Control keys. Apple's keyboards seem to have consistently had Control keys for at least a couple decades. – 8bittree Apr 05 '17 at 22:15
-
@8bittree - I've never used them in earnest, but only ever dabbled, so I have no real recollection of what models. It is certainly some time since I did so, possibly predating OS-X. – AFH Apr 05 '17 at 22:33