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

How do I do scroll_line_up with more lines on a single keystroke? #5294

Closed
Invertisment opened this issue Jul 21, 2022 · 5 comments
Closed

Comments

@Invertisment
Copy link

Invertisment commented Jul 21, 2022

I'm not sure if this is not a feature request because it could also already exist if it's possible to repeat a kitty command. I think that it doesn't exist so I ask whether there is a possibility to scroll several lines up or down.
I want this because this way I could read text more clearly after I do page scrolls and I want to see only the several next/previous lines of the output.

I'm not sure what "solution" I would like because this could be implemented in various ways.
I could do a macro on my side that repeats the key multiple times or it could be a repeat argument to the kitty terminal (something as in bash shell when I press Alt+number). It could also simply be a hardcoded number of lines to be scrolled like this: map alt+k scroll_line_up 5.
It could also probably work if I could do this (too hacky, probably you don't want to do this kind of parsing because it may interfere with other command parsing):
map alt+k scroll_line_up; scroll_line_up; scroll_line_up; scroll_line_up

Currently I press the keys multiple times to scroll lines multiple times.

@page-down
Copy link
Contributor

Currently you can use the combine action to achieve the second way.

https://sw.kovidgoyal.net/kitty/actions/#action-combine

map f1 combine : scroll_line_up : scroll_line_up : scroll_line_up

You can also scroll any line or page in the first way by binding the remote control action scroll-window.
https://sw.kovidgoyal.net/kitty/remote-control/#kitty-scroll-window

map f1 remote_control scroll-window 3-

@Invertisment
Copy link
Author

Alright. That's a pretty good way to do it.
Is it possible to scroll by half of a window? I think I can only specify lines and whole windows 🤔
https://sw.kovidgoyal.net/kitty/remote-control/#kitty-scroll-window

I tried to use

remote_control scroll-window 0.5p-

but this fails when the integer is parsed.
Is this possible to do?

@Invertisment
Copy link
Author

Invertisment commented Jul 21, 2022

I'll have this config for now (I use home-row only):

## Line up/down
map alt+k scroll_line_up
map alt+j scroll_line_down

# Page up/down
map alt+u remote_control scroll-window 30- # 25 lines
map alt+d remote_control scroll-window 30+ # 25 lines
map alt+shift+u scroll_page_up
map alt+shift+d scroll_page_down

@page-down
Copy link
Contributor

Is it possible to scroll by half of a window?
... this fails when the integer is parsed.

Not at the moment, I think this feature is useful and can be added.

For now, you can write a custom kitten to achieve that.
https://sw.kovidgoyal.net/kitty/kittens/custom/
Calculate the number of lines and scroll.

@kovidgoyal
Copy link
Owner

It should be a pretty simple patch to scroll_window.py PRs welcome

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

3 participants