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

README: Use --line-range instead of head in bat example #2064

Merged
merged 3 commits into from
Jun 4, 2020

Conversation

xeruf
Copy link
Contributor

@xeruf xeruf commented May 30, 2020

From the bat man page:

       -r, --line-range <N:M>...

              Only print the specified range of lines for each file. For example:

              --line-range 30:40
                     prints lines 30 to 40

              --line-range :40
                     prints lines 1 to 40

I think this should be more efficient than head?
And either way, it is the proper way, better to make it easy to find because it took me some time to find it 😅

Also, why 500 lines? What insane terminal is that where you can see 500 lines vertically without scrolling? ^^

@xeruf xeruf changed the title Use --line-range instead of head in bat example README: Use --line-range instead of head in bat example May 30, 2020
@junegunn
Copy link
Owner

junegunn commented Jun 1, 2020

500, which is an arbitrary number that is supposed to be larger than the height of a normal terminal, allows you to scroll down the preview window for some degree, while still limiting the number of lines fzf has to process. There is no particular reason that it should be 500, but 99 seems not enough, e.g. pivot screen.

@xeruf
Copy link
Contributor Author

xeruf commented Jun 2, 2020

how can I scroll the preview?

@junegunn
Copy link
Owner

junegunn commented Jun 2, 2020

Using mouse scroll or using custom --bind keys.

@xeruf
Copy link
Contributor Author

xeruf commented Jun 3, 2020

oh wow, I didn't even notice that - maybe add that to the README ;)

@xeruf
Copy link
Contributor Author

xeruf commented Jun 3, 2020

alright, I set it back to 500

@xeruf
Copy link
Contributor Author

xeruf commented Jun 3, 2020

and added a hint for scrolling

@junegunn junegunn merged commit 43d1c4c into junegunn:master Jun 4, 2020
@junegunn
Copy link
Owner

junegunn commented Jun 4, 2020

Merged, thanks!

@xeruf xeruf deleted the patch-2 branch June 4, 2020 11:28
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

Successfully merging this pull request may close these issues.

2 participants