vifm: Fix tabular data visidata opening and preview

Tabular data was only opened in visidata if it was a csv file,
now we also correctly open xlsx, tsv, and even json files.
Also do not display an extra file title in the tabular previewer
since we already know which file we are pointing at to gain some
space.
This commit is contained in:
Marty Oehme 2024-04-19 11:33:33 +02:00
parent cddf8618ce
commit a2d60202b9
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

View file

@ -470,11 +470,11 @@ filetype *.sqlite,*.db
\ sqlite3 %f, \ sqlite3 %f,
" tabular data " tabular data
filextype *.csv, *.xlsx, *.tsv, *.json filetype *.csv,*.xlsx,*.tsv,*.json
\ {Open with visidata} \ {Open with visidata}
\ vd %f, \ vd %f,
fileviewer *.tsv,*.csv fileviewer *.tsv,*.csv
\ tidy-viewer --color-always --title %c \ tidy-viewer --color-always %c
" \ xsv sample 100 %c | xsv table -c8 -p1 -w1, " \ xsv sample 100 %c | xsv table -c8 -p1 -w1,
" \ {cat %c | sed -e 's/,,/, ,/g' | column -s, -t | less -#5 -N -S; } " \ {cat %c | sed -e 's/,,/, ,/g' | column -s, -t | less -#5 -N -S; }
fileviewer *.xlsx fileviewer *.xlsx