Replies: 2 comments
|
You can keep syntax highlighting with decorations and paging disabled: bat --no-config --style=plain --color=always --paging=never file.pyI checked bat 0.26.1 with forced color and plain style: after removing the ANSI color sequences, the output had no extra leading spaces. So plain style itself doesn't require a one-column margin. If the command above removes the space on your machine, check the pager separately. In particular, LESS= bat --no-config --style=plain --color=always \
--paging=always --pager='less -R' file.pyThat's a diagnostic possibility, not something I can confirm from the description alone. If the space remains even with The pager documentation explains the separate pager settings. |
|
The decisive test is bat --no-config --style=plain --color=never --paging=never file.py | cat -A | headIf lines start immediately with no leading space before the echo "LESS=$LESS BAT_PAGER=$BAT_PAGER PAGER=$PAGER"
LESS= bat --no-config --style=plain --color=always --paging=always --pager='less -R' file.pyIf the space survives even |
Uh oh!
There was an error while loading. Please reload this page.
I was checking out bat to use for syntax highlighting for less (or potentially to replace less for me) and I noticed that despite telling it to use the plain style, no decorations, just do syntax highlighting, that it still inserts a space at the beginning of each line...is there any way to make it NOT do that?
If using it like "cat" I see that it doesn't do that, so feels like it should be possible and maybe I'm just missing something...
Thanks.
All reactions