-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Q: Toggle line numbers on and off while viewing - is it possible? [ANSWER: not right now] #2474
Comments
Currently, there is no way to toggle line numbers. |
@sharkdp I would love to add a PR for this. Should I? |
See also #1053 |
I don't think it's possible to implement this right now without fundamentally changing how we interact with the pager. As @keith-hall mentioned, please see #1053. |
This is also related to #1177. Closing for now. |
Thanks for the quick comments and answers |
Question
Is it possible to toggle line numbers on and off while viewing a file? (This would be useful if you ever need to cut'n'paste a few lines from a file)
Here is what I've tried
Entering
-p
Given that
suppresses line numbers, I though entering
-p
would toggle them, but instead I get an error:Looks like CLI option
-p
is overridden by an in-viewer option.Entering
-n
or-N
I view a file with:
which decorates each line with a line number. Then, when I type
-n
, while viewing, there is a message saying:Here, I expect/hope that
bat
would re-render the file and display the file without line numbers. FWIW, if I type-n
again, then it says:Entering
-n
will keep switching between these two messages, but there is no visual difference AFAICT.I also tried
-N
, but no effect.Session info
$ bat --version bat 0.22.1 (e5d9579) henrik@hb-x1-2023:~/repositories/ansible-hb-x1-20
The text was updated successfully, but these errors were encountered: