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

Add keys to browse back and forward in help-mode #4014

Conversation

AdrieanKhisbe
Copy link
Contributor

Implemented #2698

and + follow symbol with s

@StreakyCobra
Copy link
Contributor

Maybe using (also) n and N, and/or u and d can be useful here? Not sure though.

@AdrieanKhisbe
Copy link
Contributor Author

@StreakyCobra u and d are undefined.what do you want me to bind them to? :)

N/n are already bind to evil-search-next

@StreakyCobra
Copy link
Contributor

I was thinking that, as people are used to C-u and C-d to scroll, u (up) and d (down) would be kind of mnemonics. But I just tried and C-u and C-d are working so, it may not be necessary at all to add bindings?

On the other hand if we really want single-key scrolling, f, b, n and N are already used by evil, so it may be wise to use u and d instead of f and b. When in help buffers, I sometime want to select region (to copy/paste for instance) and using b to go to previous word, or f to find a symbol, are quite useful. So what do you think of using u and d instead, as:

  • d is not useful because help buffers are read-only so it's not possible to delete line; and
  • u for the same reason as there is nothing to undo because of read-only?

Retracted

@TheBB
Copy link
Collaborator

TheBB commented Dec 1, 2015

These functions don't scroll, they go back and forward between pages, like in a browser.

@TheBB
Copy link
Collaborator

TheBB commented Dec 1, 2015

In info the ] and [ keys go forward and back. I like those.

@StreakyCobra
Copy link
Contributor

Yeah, as I said in my previous (wrong) comment, I use f and b sometimes and I'm probably not the only one, so it may be wise to find better bindings.

@AdrieanKhisbe
Copy link
Contributor Author

I mean keys

@StreakyCobra
Copy link
Contributor

I'm not sure f and b should be used as the override some useful evil bindings, @TheBB What do you think?

u and d are fine for me. I can live with C-u and C-d only though.

@AdrieanKhisbe
Copy link
Contributor Author

@StreakyCobra I didn't touch to f and b for these reasons

@@ -50,6 +50,14 @@
;; let TAB jump between links in help buffers
(evil-define-key 'motion help-mode-map (kbd "<tab>") 'forward-button)
(evil-define-key 'motion help-mode-map (kbd "S-<tab>") 'backward-button)
;; let n and p to navigate between pages
(evil-define-key 'motion help-mode-map (kbd "f") 'help-go-forward)
(evil-define-key 'motion help-mode-map (kbd "b") 'help-go-back)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are adding f and b here no? Or did i missed something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, forgot I made a mistake as it seems: cf the comment :D

@@ -50,6 +50,14 @@
;; let TAB jump between links in help buffers
(evil-define-key 'motion help-mode-map (kbd "<tab>") 'forward-button)
(evil-define-key 'motion help-mode-map (kbd "S-<tab>") 'backward-button)
;; let n and p to navigate between pages
(evil-define-key 'motion help-mode-map (kbd "n") 'help-go-forward)
(evil-define-key 'motion help-mode-map (kbd "p") 'help-go-back)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But now n is also used by evil for searching 😜

Simply keep [ and ] for sure, and s, u and d if you think they are useful ☺️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed. ^^

Add keys to browse back and forward in help-mode

cf syl20bnr#2698

Add new key in help-mode

Last changes for motion in help buffer
@AdrieanKhisbe
Copy link
Contributor Author

modified and accordingly, and squashed commit

@StreakyCobra
Copy link
Contributor

👍

@AdrieanKhisbe
Copy link
Contributor Author

:)

@syl20bnr
Copy link
Owner

syl20bnr commented Dec 4, 2015

I'm not sure we need u and d, there is already C-u and C-d which are consistent accross Emacs. I find it not really useful to create a specificity in help mode.
Follow-symbol should be on mhh (major-mode binding) to be consistent with the conventions, s is useful for people using evil-sniper.
Also for forward and back I propose the additional gf and gb.

@AdrieanKhisbe
Copy link
Contributor Author

@syl20bnr Applied your recommandations :)
(I still have to lean vim conventions :D)

@syl20bnr
Copy link
Owner

syl20bnr commented Dec 9, 2015

Thank you 👍
I replaced mhh by gh and added the documentation where I could, see commit 5895e0e
Cherry-picked into develop branch, you can safely delete your branch.

@syl20bnr syl20bnr closed this Dec 9, 2015
@AdrieanKhisbe
Copy link
Contributor Author

@syl20bnr great :)

@AdrieanKhisbe AdrieanKhisbe deleted the features/navigation-help-mode branch December 9, 2015 06:57
@AdrieanKhisbe AdrieanKhisbe restored the features/navigation-help-mode branch December 11, 2015 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants