bat-extras icon indicating copy to clipboard operation
bat-extras copied to clipboard

Feature request: support for tsv files in pretty bat

Open jrom99 opened this issue 1 year ago • 1 comments

For TSV files, the default bat behavior doesn't take data length into account to define header width.

I'd like to propose using column to format such files, like the following function:

# optionally have "--wrap never" for wider files
function() {
  file="$1"
  shift
  column --keep-empty-lines --table -s $'\t' -o $'\t' "$file" | bat -l tsv --tabs 0 --file-name "$file" "$@"
}

jrom99 avatar Apr 04 '24 03:04 jrom99

I wasn't able to add support in the exact way you described, but basic support for this is implemented in 043d2da9645fa1a625e85a1f68f43adbffe219c7.

eth-p avatar Jun 01 '24 22:06 eth-p