Hello, I guess my screenshot will be self-explanatory:
I want to set alt-down to move a line down…
Where’s your cursor in all this? None of the available options are getting selected, which suggests that no viable element is in focus.
You should just move all of those bindings under
I tried with setting my cursor to different lines and firing the shortcut (alt-down) - nothing happened - but it always seems that “native!” comes first in priority.
X, though? That indicates that the binding is not matched with anything in the element(s) associated with the event. When the selector matches an element, there will be a checkmark.
That’s why I think you should simplify your selectors. If you don’t need specificity, it’s a distraction and an extra set of variables.
I just tested the following:
'atom-text-editor': 'alt-down': 'editor:move-line-down'
It worked great.
I think I figured what the problem is (still dont know how to fix it)
it conflicts with ctrl-alt-down (which I use for duplicating a line)
the last one to appear in the file takes precedence and ‘disables’ the other. (like CSS I guess)
'atom-workspace atom-text-editor:not([mini])': 'alt-up': 'editor:move-line-up' 'ctrl-alt-down': 'editor:duplicate-lines' 'alt-down': 'editor:move-line-down'
worked. But I must say guys, I did plenty of googling to find solid examples of keymap cson files and how to do stuff, in vain… And I’m a front-end developer - so I get pretty well how selectors work. There’s definite need for solid documentation and examples of how this works. Also I think keymap and keybinding are used to describe the same thing, makes it hard to research for stuff.
No, it didn’t work. Still, its’ either ctrl-alt-down or alt-down depending on the order of appearance in the file.
There is solid documentation on this site. No need to Google for it.
I’m confused about the other issue.
ctrl-alt-down should not be in conflict. Mind posting shots of the keybinding resolver?
Alt+Ctrl+Down isn’t conflicting with Alt+Down, you have two keys that are identical. See the warning box in the “Configuring with CSON” section of the Atom Flight Manual here: