spacehammer
spacehammer copied to clipboard
Suggestion: require config opt-in to enable Opt+N, Opt+P bindings
These interfere with using Opt+N to add an accent character ("ñ"), and since the way Hammerspoon binds keys isn't visible from the System Preferences Keyboard panel, this can lead to surprising the user.
IIRC this binding wasn't present in a prior version of Spacehammer, so I was surprised 😄
Yeah, we need to find a better way of dealing with global keybindings. Initially I had all the major keys set to be used with CMD. That turned out to be a problem. CMD used heavily in OSX, so we decided maybe it's better by default to bind global keys to Option|Alt. See https://github.com/agzam/spacehammer/issues/30. But that's not ideal either. Plus, we need to re-think user's localized config values. Also Option+n/p (hs.window.switcher
) has some other issues, it's not extremely reliable, and painfully slow.
Thank you for highlighting the issue. Will give it a thought.
Just to leave a note on that suggestion, which seems very sensible...I was very confused by this for a long time, thinking macOS had some kind of undocumented neat trick!
Perhaps you might explain the best way to disable such an option, apart from simply commenting it out (totally missed that Fennel is a Lisp, so .fnl are just Lisp files, in which case good ol' Lisp commenting with semi-colons is in effect! ~~actually, because of a problem right now in how lua-mode
is behaving in my 27.1, I realize that I'm not actually sure what the comment symbol is in Lua!~~)
Or at least for now, it might be wise to draw greater attention to those particular Opt+N/P keybindings in the README, as I was deeply puzzled about why I had lost my M-n
and M-p
like, in so many places where Emacs or various Emacs packages relies on them.
hs.window.switcher
is definitely a kinda cool feature, so others might want to rebind it. But I will confess to being bewildered--hopefully others are less obtuse than me!
EDIT: DON'T do the following, which at least kept Hammerspoon from complaining on reload, but definitely doesn't work:
For anyone struggling with commenting out the lines that cover this in config.fnl
, the hack-ish way is to kill the whole "local common-keys" block and then kill the keys common-keys
entry in the "local config" block at the bottom.
What about the following:
- Comment out the extra features in the default config.fnl that would conflict with bindings, or that we would not consider essential features
- Add more to the docs about what's in the default config.fnl and guiding users to enable some of those features
This way we're introducing new users to their config.fnl, but not making too many assumptions about their bindings. Thoughts?
Yep, that sounds like an ideal way to balance all the different needs and desires, totally.