bat
bat copied to clipboard
Print only vertical grid line
At the moment, the only way to get the vertical grid line that separates the line numbers and the actual content seems to be with --style=gird
, but this also prints the horizontal grid lines at the top and bottom of the page, like this:
─────┬──────────────────────────────────────────────────────────────────────────
1 │ This is a test file with a few lines.
2 │ Here is a line.
3 │ Here is another line.
4 │ And this is the last line.
─────┴──────────────────────────────────────────────────────────────────────────
It would be good to be able to print only the vertical line without the horizontal lines, like this:
1 │ This is a test file with a few lines.
2 │ Here is a line.
3 │ Here is another line.
4 │ And this is the last line.
And ideally, that should also work with --style=rule
, to produce something like this when two files are passed in:
1 │ This is a test file with a few lines.
2 │ Here is a line.
3 │ Here is another line.
4 │ And this is the last line.
─────┼──────────────────────────────────────────────────────────────────────────
1 │ This is another test file. It has lines in it.
2 │ This is the second line. The line above was the first.
3 │ And this is the third and final line.
Thank you for your feature request. May I ask what your use case is?
Keeping the line numbers of the input matched to the line numbers of the output while still keeping the vertical separator between the line number and the line itself.
I was just wondering, so let me ask you a simple question.
Is it not enough to use nl
command?
For example, the command bat <filename> | nl -s " | "
will print only vertical lines.
(Or, does nl
command not satisfy your requirements?)
I would like something similar to this as well: I'd like a line between the line numbers and file content, and I'd like the line between the header and the file content, and lines between files, but I don't want a line before the first file or after the last file. That would allow more content to fit on one screen, while still keeping things separated.
+1 This would be great for fzf preview windows with filename in preview label.