How to quickly create one-off shortcuts


#1

In Vim, I often create one-off shortcuts for the task at hand, using the leader key, something like:

set nnoremap <leader>r :sh script/do-a-cool-thing<CR>

Is there a way to do this kind of quick ephemeral remapping in Atom?


#2

Did you check the VIM package readme? I think you would need to post a feature request on the vim package github repo.


#3

I don’t necessarily want it to be a Vim-related thing, I just used Vim to explain the concept: creating temporary shortcuts that go away once the editor closes. Doesn’t have to be related to the leader concept, it could be any key


#4

I believe it can be done, but I think it’ll be tricky. Shortcuts are bound to scopes (and selectors priority) so if you want to override a binding you’ll have to provide a more specific scope than the one that is triggered normally. I don’t have a solution at the moment but I’ll try to a look at that later.


#5

So, what you’re saying is, this is a good opportunity for me to try my hand at writing Atom plugins :smile: