You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo Lorem ipsum dolor sit a met, \
consectetur adipiscing elit. \
Nullam venenatis nec est \
eu tristique \
| bat --decorations=never \
--paging=never \
--language bash \
--theme Nord \
--color=always \
--terminal-width 11 \
--wrap character \
-
Suggestion
I suggest a new word mode for the --wrap option, which will split lines only by spaces (except in cases where a word is too long for a single line). These spaces should then be stripped
An example of how it should look with --wrap word:
The text was updated successfully, but these errors were encountered:
@einfachIrgendwer0815, unfortunately, this workaround will break syntax highlighting, which goes completely against the initial purpose of using bat for syntax highlighting:
echo Lorem ipsum dolor sit a met, \
consectetur adipiscing elit. \
Nullam venenatis nec est \
eu tristique \
| bat -p \
| fold -w 12 -s \
| bat --decorations=never \
--paging=never \
--language bash \
--theme Nord \
--color=always \
-
Ok, I just have found a better workaround that works in my case:
echo Lorem ipsum dolor sit a met, \
consectetur adipiscing elit. \
Nullam venenatis nec est \
eu tristique \
| fold -w 12 -s \
`# replace newlines by unique` \
`# invisible character that ` \
`# is ignored by syntax ` \
`# highlighting ` \
| sed -zE "s/\n/\x2062/g" \
| bat --decorations=never \
--paging=never \
--language bash \
--theme Nord \
--color=always \
- \
`# revert it back ` \
| sed -zE "s/\x2062/\n/g"
The current
--wrap character
behaviorSuggestion
I suggest a new
word
mode for the--wrap
option, which will split lines only by spaces (except in cases where a word is too long for a single line). These spaces should then be strippedAn example of how it should look with
--wrap word
:The text was updated successfully, but these errors were encountered: