Creating a keymap for save


#1

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.


#2

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:

'atom-text-editor:not([mini])':
  ', w': 'core:save'

#3

Thanks! Using core:save worked when I added:

'atom-text-editor.vim-mode-plus.insert-mode':
   ', 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?


#4

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.


#5

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


#6

No problem. :slight_smile: