atom / atom-keymap

Atom's selector-based keymap system
MIT License
105 stars 57 forks source link

Sass/Less-like '&' functionality? #109

Open danielbayley opened 8 years ago

danielbayley commented 8 years ago

Would it be theoretically possible to do something like this for example…

'.platform-darwin atom-workspace atom-text-editor':
    'key-s': 'some:command'
    '&:not([mini])': # or .parent-class & or &.another-child-class
        'key-z': 'another:command'

rather than…

'.platform-darwin atom-workspace atom-text-editor':
    'key-s': 'some:command'
'.platform-darwin atom-workspace atom-text-editor:not([mini])':
    'key-z': 'another:command'

It would do wonders for the maintainability of large config files like the keymap (or snippets for example).

nathansobo commented 8 years ago

It would be possible, but I'm not inclined to add complexity to this component for the time being. We'd like to add a better UI for defining key bindings at some point in the future which could build on the existing data format, and I'm concerned that complicating it could make that more difficult.