-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Consistency of bindings in transient states (SPC, q, C-g, ESC, etc.) #6992
Comments
My opinion on the subject: (just an opinion)
Code Folding TS: Layout TS: TS's are defined by using the |
This was added to disable |
Really? That's different than what I'm experiencing. In scratch buffer, evaluate this code: (spacemacs|define-transient-state test
:title "Test TS"
:foreign-keys run
:bindings
("q" nil :exit t)) Then:
This is with latest develop branch and updated packages. System Info 💻
(helm
(auto-completion :variables auto-completion-enable-snippets-in-popup nil auto-completion-enable-help-tooltip 'manual company-tooltip-align-annotations t)
command-log dash evil-cleverparens
(git :variables git-magit-status-fullscreen t)
ibuffer imenu-list nlinum org pdf-tools
(shell :variables shell-default-shell 'shell shell-default-height 30 shell-default-position 'bottom)
smex syntax-checking version-control yaml c-c++
(clojure :variables clojure-enable-fancify-symbols nil)
emacs-lisp
(latex :variables latex-enable-auto-fill t latex-enable-folding t)
markdown octave python ruby common-lisp org-tweaks spaceline-tweaks window-purpose window-tweaks themes-megapack
(theming :variables theming-modifications
'((spacemacs-dark
(aw-leading-char-face :foreground "red" :height 3.0))
(spacemacs-light
(aw-leading-char-face :foreground "red" :height 3.0))
(monokai
(aw-leading-char-face :foreground "red" :height 3.0))
(flatland
(aw-leading-char-face :foreground "red" :height 3.0))))) |
Hmm. My bad. I had So if Although, I would probably keep |
Closing #6991 in favour of this. I guess the topic is consistency of bindings in transient states. |
👍
That doesn't take care of other prefixes, e.g. (spacemacs|define-transient-state test
:title "Test TS"
:foreign-keys run
:on-enter (spacemacs/toggle-which-key-off)
:on-exit (spacemacs/toggle-which-key-on)
:bindings
("q" nil :exit t)) I wonder if this should the default TS behavior. |
@TheBB Rename the issue then to "Consistency of key bindings(SPC, q) in transient states". Also, it'd be better if we can pull the information present in the other thread here to have it in one place. bmag and duianto have good points/opinions on usage of |
Nice. 👍 Didn't think of it. I can make the PR if everyone agrees on disabling |
The original rational for disabling which-key was that quitting it with P.S. I should have included it in my previous comment, but didn't think of it then |
Actually, it's only for For other transient states this might not be the case. From consistency point of view, if we're keeping |
The thing is that which-key is still helpful for non-TS binding in this case, at least theoretically. But you're actually using this specific TS, while I'm just hypothesising. If using |
I haven't found a use case(yet!) where I have used |
When any key that isn't defined in a TS is pressed then the TS closes. But that key behaves as if the TS wasn't open. So when then the TS closes, but the next key that's pressed starts recording a keyboard macro to that key.
There seems to be two places where Code Fold TS's are defined, the one that opens by default when
the other place where a Code Fold TS is define:
i'm not sure where the "evil config" is?
Sorry for taking so long to answer, i wrote answers to these questions yesterday, but i had the comment panel in Preview mode and got sidetracked. When i got back to this page, then the preview mode looked like i already had pressed the Comment button. Well at least some more info got included the second time around. |
So, from my understanding, these are the current decisions: (including discussion from #6991)
We're waiting a few days to let other people voice their suggestions (if any), then one of us can implement the changes. (I wanted to say I'll do it, but not sure I'll have the time) Re Re two Case Folding TS's: that's expected. The one that is really used depends on |
I didn't follow this before hence voicing my opinion now. I find following behaviour more intuitive in Layouts TS(when pressed
Not sure if this feature request belongs here, but since we're talking of defining conventions, might help. Thoughts? |
I see no harm in keeping There was a discussion a month ago about refactoring the Layouts TS, but it kind of fizzled away: #6763. |
Just tested it and replacing |
@duianto yes, that was the intention. I can't figure out if you consider this a good thing or a bad thing. |
Sorry for being unclear, it's good that C-m works the same as . As i stated in the initial post. I use C-m more often, because it's easier to reach than having to stretch the right hands pinky to reach the return key. On this keyboard there are two keys between the home row position of the right hands pinky and the return key. If the RET key is going to be bound to exit a TS then it's also good that C-m doesn't move the cursor like it currently does. I'm fine with both cases, if the return key does or does not close a TS. but it's probably a good idea to be consistent in most/all of the TS's. |
Should I think Regarding @nixmaniack's suggestions for the
Similarly, perhaps
instead of the current, unconditional quit on-exit:
enabling 1: and/or edit: regarding edit: edit: FWIW, I'm happy thus far with my code regarding my prior two edits -- edit: Sorry about my rebasing/cherry-picking spam below -- I really shouldn't be modifying public git history in the first place... that said, still very happy with both of my modifications. I may or may not bump this issue at some point to gauge interest in a PR (or two). |
The magit buffer closing, when one just want to close the layout transient state, is an unexpected behaviour, and that should be fixed. I don't know enough about the other suggestions to have an informed opinion. |
* if `<escape>` is unbound in the definition of the transient-state, then default it to just exit the hydra instead of exiting the hydra and additionally sending <escape> to the most recently selected buffer * ref: syl20bnr#6992 (cherry picked from commit 4f1d87d55949cefd2bf46de42f6c2fac43b77626)
* analogous to `RET` in `spacemacs/layouts-transient-state` * ref: syl20bnr#6992 (cherry picked from commit 8b12944)
* analogous to `RET` in `spacemacs/layouts-transient-state` * ref: syl20bnr#6992
* if `<escape>` is unbound in the definition of the transient-state, then default it to just exit the hydra instead of exiting the hydra and additionally sending <escape> to the most recently selected buffer * ref: syl20bnr#6992
* if `<escape>` is unbound in the definition of the transient-state, then default it to just exit the hydra instead of exiting the hydra and additionally sending <escape> to the most recently selected buffer * ref: syl20bnr#6992 (cherry picked from commit 4f1d87d55949cefd2bf46de42f6c2fac43b77626)
* analogous to `RET` in `spacemacs/layouts-transient-state` * ref: syl20bnr#6992 (cherry picked from commit 8b12944)
@braham-snyder I do not consider the rebasing/cherry-picking to be spam, they are just progress reports 😄. It's great that your finding better (possibly more consistent) keybindings for exiting from the transient states 👍 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid! |
Should we consider to use I am posting it here because the comment seems to be newer than any comment here. So maybe this issue is worth reconsidering? (then please re-open the issue). Personally, I have found no unwanted effects. Maybe you can try if this function causes any unwanted effects for you? |
Which keys should be bound in the Transient States to quit/close.
Currently these Transient States have the [q] key bound to quit:
Buffer Selection
Code Fold
Error
Font Scaling
Git Timemachine
Transparent
MacroStep
Window Manipulation
Zoom Frame
But these do not have [q] bound to quit:
Evil Numbers
Layout
Move Text
Scrolling
Workspaces
The Code Folding TS also has C-g and SPC bound to
nil
, but C-g doesn't seem to be needed, since the other TS's close when C-g is pressed.The Layouts TS has bound to
nil
. If the other TS's also should use to quit/close, then C-m(evil-ret)
probably should be bound as well, i use it more often than reaching for with the right hands pinky.I'm not sure if these are all the TS's, but the once above except MacroStep shows up as results when searching the HELM Descbinds SPC ? transient RET
System Info 💻
The text was updated successfully, but these errors were encountered: