Creating a keymap for save


I want to map ,w to save file event. How can I do that?

I tried the following, but none of these works.

'atom-text-editor.vim-mode-plus.insert-mode': ', w': 'editor:save'
'atom-text-editor.vim-mode-plus.insert-mode': ', w': 'keystroke Cmd+s'
'atom-text-editor.vim-mode-plus.insert-mode': ', w': 'keystroke Cmd-s'
Thanks for your help.


The command is core:save not editor:save. Also the command and selector should be on separate lines.

I used this to test and it worked:

  ', w': 'core:save'


Thanks! Using core:save worked when I added:

   ', w': 'core:save'

However, when I added the snippet posted by you as given, it did not work. I am not sure why. Is it because vim-mode-plus was overriding that?


You can open the Keybinding Resolver (ctrl-.) and press the binding in question to see the internal workings of how Atom selects a particular command. Post a screenshot here and we can probably tell you what you need to do.


Seems like it is working today. Thanks, however, for this awesome tip.


No problem. :slight_smile: