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
A key with the
Ctrlkey modifier is represented using the
<C-key>notation. For example
Ctrl-Ris represented using
<C-R>. A key with the Shift key modifier is represented using the
<S-key>notation. For example
Shift-F2is represented using
<S-F2>. A key with the
Altkey modifier is represented using
<M-key>notation. You can combine one or more key modifiers. For example, to represent
Ctrl+Shift+F3you can use
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.
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?