jbranchaud / splitting-atoms

:dizzy_face: a community-built, community-driven guide to hacking on the Atom editor
http://jbranchaud.github.io/splitting-atoms/
MIT License
355 stars 29 forks source link

What happens when two packages have conflicting key map settings? #69

Open jbranchaud opened 10 years ago

jbranchaud commented 10 years ago

I am wondering how Atom handles a situation when two packages try to define the same keybinding for different functionality? I am going to look into this myself, but figured I would put this issue up for anyone who already has some insights.

Also, this may be worth a write up somewhere in the site depending on what we find and how that info might be utilized when creating a new package.

tombell commented 10 years ago

I think last package loaded wins.

jbranchaud commented 10 years ago

Interesting, and what about keymap.cson in ~/.atom? Does that trump all? Also, you can assign keybindings in init.coffee. Ahhh.

tombell commented 10 years ago

I also found this http://discuss.atom.io/t/keymap-style-guide/4432

jbranchaud commented 10 years ago

@tombell thanks for the link, that is really helpful. We will have to note some of that in the docs somewhere, perhaps in best practices.

I am thinking about throwing together a package that checks all the keybindings of enabled packages and keymap.cson and alerts you when there are conflicts so that you can figure out if certain functionality is being clobbered. Perhaps a status bar indicator that can be clicked to pull up a view of conflicting keybindings.

jbranchaud commented 10 years ago

With regard to my last comment, it looks like I completely missed the keybinding resolver package that ships with Atom. Open it with Cmd-. and then try out different keybindings to see what they resolve to and what commands are being clobbered (source).