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

Default binding stomps over (presumably) popular ⌘+N for new window shortcut #30

Closed
anshukla opened this issue Dec 27, 2019 · 9 comments

Comments

@anshukla
Copy link

anshukla commented Dec 27, 2019

More a wondering than an issue, explicitly: the default bindings for spacehammer use ⌘+N for alternative app switcher. Unless I'm missing something, there is consequently no shortcut left for making new windows. Is that something that you don't need in your workflow by default or do you fallback to a different means of making new windows in, e.g., your browser?

@agzam
Copy link
Owner

agzam commented Jan 2, 2020

That you for your feedback, it's definitely a valid concern, right now we have a number of key-combos with CMD modifier, maybe it would be better to avoid using CMD+... altogether and instead do it maybe with Alt/Option.

Long term plan perhaps should be to design and develop actual Normal/Edit mode, but I don't know how confusing that kind of (system-wide) workflow would be. i.e.: if we make it so SPC works as a leader key (just like in Spacemacs) how that would work with the modal-editors, would you have to press i twice to switch to insert mode, and tap on Esc two times to switch back to Normal - first to normal mode in the editor, and then to system-wide normal mode?

Short-term solution maybe simply to use something else for the app-switcher. Maybe Alt+..., you can try changing the sequence here https://github.com/agzam/spacehammer/blob/develop/config.fnl#L317.

I initially set the app-switcher keys to CMD+p/n without much thinking, if you suggest a better alternative, I would be happy to make that change.

@anshukla
Copy link
Author

anshukla commented Jan 6, 2020

Regarding the long term plan: right now, compatibility issues are elided by hijacking cmd+spacebar which developers never use due to the Spotlight default. I think thinking of cmd+spacebar as the leader key which not only brings up the modal view but also activates the other interesting shortcuts like app switcher would be a good approach. However, I think this would effectively need a solution for #1.

In the short term, I'm sure everyone has their own workflow and keybindings which make some modifiers better than others. I've been trying out alt+shift and it seems to work well with minimal app-specific hotkey conflicts.

@jaidetree
Copy link
Collaborator

A friend of mine has unfortunately stopped using Spacehammer due to losing their goto shortcuts like reported here.

I think we should think carefully about what should be a default setting and what should go in our personal configs.

In so far I propose:

  • cmd + n - Next app in the app switcher
  • cmd + p - Prev app in the app switcher

Be commented out in the default config. You can easily customize it by copying the repo's config.fnl into private/config.fnl. What are your thoughts @agzam?

@agzam
Copy link
Owner

agzam commented Jan 14, 2020

I think I made a mistake in the beginning by choosing CMD as the leading modifier. I don't know, maybe we need to reconsider using it at all and make a global change. I know - it's pretty drastic, but I think we have to do it while we still can.

Maybe even stop using CMD in the main combo and instead of CMD+SPC maybe use Alt+SPC.

In my defense, I can only say: I never thought this project would be used by anyone else but me, and even if it would - it's not that difficult to change it. I was wrong.

But first, I want to merge develop to master. The longer we wait, the bigger it gets. I just wanted to improve documentation and remove things that are no longer needed, but I think we cannot postpone the release any longer. We can clean up things later.

@eccentric-j, I remember when you said: "Spacehammer to Hammerspoon can potentially become like Spacemacs to Emacs." If we don't release develop soon enough, that becomes a prophecy. Almost nobody uses the master of Spacemacs anymore, and everyone's on develop.

@agzam
Copy link
Owner

agzam commented Jan 14, 2020

@eccentric-j when you have time, could you please create a wiki page (or maybe its better have it within the project in ./documentation folder?) with an example of minimal private/config.fnl and link to it from the readme?
Also maybe we should consider moving private somewhere outside of ~/.hammerspoon, so people can maintain it in version control?
Something like ~/.spacehammer/config.fnl maybe?

Also maybe we should create that file the first time when user runs Spacehammer. Keep it in a template somewhere and based on that template create the file (if it doesn't exist). Later we can maybe even develop some kind of versioning system, with a warning that private config template got updated or something. Or a changelog dialog of some sort (when we detect changes - when user pulls new version of Spacehammer).

@jaidetree
Copy link
Collaborator

jaidetree commented Jan 14, 2020

That's a fair point. I'll focus on writing docs this week to get it ready for launch ASAP.

It would be pretty trivial to change the config.fnl to support using alt+spc and remove cmd overrides. Personally, I've grown quite used to cmd + space and will keep that in my custom config.

Sure, I can write a minimal config.fnl in a documentation folder and link to it in the wiki if desired.

As for the private config folder, the ~/.spacehammer/private folder is already in the .gitignore. Currently, in my setup, I am symlinking /private to a folder spacehammer in my dotfiles repo so I can use separate version control. 😄

When I did try to set up a ~/.spacehammer directory, I had added it to the fennel import paths in init.fnl. That caused issues as it meant an ~/.spacehammer/init.fnl would override the root init.lua required to load fennel and run the core. If there's a better way to work with that ~/.spacehammer dir, I'm all for it.

The private subdir follows the behavior of any fennel module folder. I figure it would be better to go with the conventions of fennel than introduce too many customizations.

@jaidetree
Copy link
Collaborator

jaidetree commented Jan 14, 2020

After more thought, I think it may be better to have a well documented, fully-featured default config.fnl instead of a minimal one in .documentation. The README of the develop branch already covers the private dir. The goal is that users should become familiar with that file anyway. Customizations should be made by copying it and modifying it to fit their needs.

Otherwise, that's going to circle back to this discussion of what's default and what's extra? I do agree with changing the default to use alt + space and replacing the cmd bindings.

jaidetree added a commit to jaidetree/spacehammer that referenced this issue Jan 14, 2020
- No new functionality is introduced
- Discussed in agzam#30
@anshukla
Copy link
Author

A workflow I've been using for customizing since that's come up in this discussion is to maintain my own fork of spacehammer which I have as a submodule in my dotfiles repository. I periodically rebase my fork with the latest changes in upstream/master (in theory, but develop for now).

The improved config file would be a huge boon, since it took me a while of playing around before I understood fennel, on top of lua, well enough to see where customizations should be made. I have more ideas about customization management, but maybe there's a more pertinent issue where I can write them instead of driving this one further off topic?

jaidetree added a commit to jaidetree/spacehammer that referenced this issue Jan 15, 2020
- No new functionality is introduced
- Discussed in agzam#30
@jaidetree
Copy link
Collaborator

Please create another issue if you would like to propose some config management solutions.

I was able to solve the issue I ran into last time and created a PR to change the config folder to ~/.spacehammer/config.fnl. #35

jaidetree added a commit to jaidetree/spacehammer that referenced this issue Jan 21, 2020
- Generate ~/.spacehammer/config.fnl if one does not exist
- Discussed in agzam#30

Updated README.md to reference new ~/.spacehammer config dir

Created routine to create a default custom config.fnl by default

Updated docs to reflect automatic custom config generation
jaidetree added a commit to jaidetree/spacehammer that referenced this issue Jan 27, 2020
- Opening the menu is `alt + space`
- Switching to the previous app is `alt + p`
- Switching to the next app is `alt + n`

Attempts to fix agzam#30
@agzam agzam closed this as completed in 8b056f4 Feb 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants