I'm trying to make it so I can write a buffer to disk with one keystroke.
(Side note: ideally, I'd like this to work in all modes, but for the moment as a start I'm just trying to get it to work in normal mode.)
On the Vim wiki it says...
Vim supports representing control characters using symbolic notation like
<F1>,<C-W>,<C-S-F1>, etc.
And also...
A key with the
Ctrlkey modifier is represented using the<C-key>notation. For exampleCtrl-Ris represented using<C-R>. A key with the Shift key modifier is represented using the<S-key>notation. For exampleShift-F2is represented using<S-F2>. A key with theAltkey modifier is represented using<A-key>or<M-key>notation. You can combine one or more key modifiers. For example, to representCtrl+Shift+F3you can use<C-S-F3>.
That seems to be saying that if I put this in my .vimrc it should work...
nnoremap <S-C-k> :w<CR>
But it has no effect. When I reload .vimrc and press shift+control+K no [File] written message appears in the bottom area.
I also tried this one but then option+K had no effect either...
nnoremap <M-k> :w<CR>
No error messages.
I'm on OS X.
UPDATE
Ok I just tried this...
inoremap <M-s> Hey whats up
Then when I go into insert mode and press option+S, Vim outputs...
ß
Is OS X intercepting my keystrokes before Vim even receives them? Is that why this isn't working?
If so, is there a way to make it stop doing that other than buying a different computer?
<M>instead of<S-C>. I'm not using MacVim. I'm using regular Vim 7.4.1129 installed via MacPorts. – Ethan Mar 06 '16 at 18:38:nnoremap <S-C-f> :w<CR>working fine on a Windows gVim 7.4 and a CentOS terminal vim 7.4 so maybe it comes from something in your setup. – statox Mar 07 '16 at 12:26:inoremap ß Hey whats up. – Amadan Mar 08 '16 at 05:03<S-C-k>is three keystrokes. Just sayin'. – Antony Aug 04 '16 at 19:53