Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: require config opt-in to enable Opt+N, Opt+P bindings #64

Open
arubis opened this issue Jul 17, 2020 · 4 comments
Open

Suggestion: require config opt-in to enable Opt+N, Opt+P bindings #64

arubis opened this issue Jul 17, 2020 · 4 comments

Comments

@arubis
Copy link

arubis commented Jul 17, 2020

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 😄

@agzam
Copy link
Owner

agzam commented Jul 28, 2020

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 #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.

@cicerojones
Copy link

cicerojones commented Sep 9, 2020

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.

@jaidetree
Copy link
Collaborator

jaidetree commented Sep 9, 2020

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?

@cicerojones
Copy link

Yep, that sounds like an ideal way to balance all the different needs and desires, totally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants