Bat: Feature Request: shortcut to turn off/on line numbers and frames for easy copying from terminal

Created on 2 Sep 2020  路  3Comments  路  Source: sharkdp/bat

I end up in situations that I would like to copy&paste multiple lines from terminal running bat,
the problem is that with line numbers and frame (e.g. "|" pipe) decorations it's not optimal.

It would be great if I could easily with one button turn on/off all line numbers/decorations to make it easy for copy from terminal , and later come back to default viewing mode.

feature-request

Most helpful comment

Hmm, I came here to request this too. (I think #1053 is a different issue, although it could probably fix things too).

You can sort do this by adjusting the BAT_STYLE env var, however I'm not sure how to get the behavior of BAT_STYLE=auto but never including line numbers or anything else in the gutter (the gutter is what makes copy from terminal difficult).

Ideally I could do something like BAT_STYLE='auto,-numbers,-changes' but for now I've just set BAT_STYLE='header,grid' which seems to mostly do what I want (syntax highlighting and file header, but no gutter).

All 3 comments

Unfortunately, that is not possible with less (see #1053).

However, you could take a look at this section: https://github.com/sharkdp/bat#xclip

Hmm, I came here to request this too. (I think #1053 is a different issue, although it could probably fix things too).

You can sort do this by adjusting the BAT_STYLE env var, however I'm not sure how to get the behavior of BAT_STYLE=auto but never including line numbers or anything else in the gutter (the gutter is what makes copy from terminal difficult).

Ideally I could do something like BAT_STYLE='auto,-numbers,-changes' but for now I've just set BAT_STYLE='header,grid' which seems to mostly do what I want (syntax highlighting and file header, but no gutter).

Ideally I could do something like BAT_STYLE='auto,-numbers,-changes'

see #1032

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adamtabrams picture adamtabrams  路  3Comments

lilyball picture lilyball  路  3Comments

samuelcolvin picture samuelcolvin  路  3Comments

jkaan picture jkaan  路  3Comments

HakubJozak picture HakubJozak  路  3Comments