Can't create keybinding for cmd-<


#1

I tried setting up a keybinding for cmd-< and cmd-> for top/bottom of buffer and I’m having some trouble. Here’s the keymap:

'.editor':
   'cmd-<' : 'core:move-to-top'
   'cmd->' : 'core:move-to-bottom'

For some reason cmd-> is working but cmd-< isn’t having any effect. It looks like Atom thinks that it’s bound the key properly:


#2

Try using cmd-. (cmd period) to display keybinding resolver and see if something else is grabbing the key first. I’m using:

'.workspace .editor:not(.mini)':
    "cmd-<": "core:move-to-top"
    "cmd->": "core:move-to-bottom"

Perhaps the extra specificity is helping me. (And I assume you are an emacs expat? Me too.)


#3

Most likely …

@demmer The Keymaps documentation, specifically the section on Specificity and Cascade Order, might be helpful too.


#4

Thanks. That did the trick.

And yes I am a long-standing emacs user dipping my toes carefully into the brave new world of editors. So far atomic-emacs has filled some of the gap but if there’s anything else you use I’d love to know.


#5

There are a couple of packages you might find useful here: https://atom.io/users/mkleehammer

I’ve decided if I’m going to stop using emacs I’m not going to carry all keys forward and come up with new ones that are more standard and take advantage of the new ecosystem. I’m adding the features I really miss and really rethinking them.

For example, I used M-z / zap-to-character a lot in emacs. For Sublime and Atom I wrote similar packages that selects to the given character instead. It requires one more key to delete to the character (select then delete), but also allows for easy copy, cut, add quotes around, etc.

I used emacs’ registers a lot, but for the Sublime package I wrote I allowed registers to have names longer than one character, used the fuzzy finder to choose one, etc. I then allocated one “quick” register with the keystrokes cmd-k cmd-c to copy to it, cmd-k cmd-x to cut to it, and cmd-k cmd-v to paste from it.

Right now the missing incremental-search is really killing me but most non-emacs users don’t seem to understand the value of super-fast navigation using isearch. I plan on writing an isearch package next.