From 8c9a233a8b29cf2efbce31a27f1107e4c1e0689a Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 12 Dec 2023 12:21:59 +0100 Subject: [PATCH] vifm: Improve file preview for tabular data Slightly improved display of csv files and added tsv to same preview. Added nice previews for json and excel files. --- terminal/.config/vifm/vifmrc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/terminal/.config/vifm/vifmrc b/terminal/.config/vifm/vifmrc index 0375b97..55362ad 100644 --- a/terminal/.config/vifm/vifmrc +++ b/terminal/.config/vifm/vifmrc @@ -215,7 +215,7 @@ set viewcolumns=-{name}..,6{}. " Filter-out build and temporary files " -" filter! /^.*\.(lo|o|d|class|py[co])$|.*~$/ +filter! /^.*\.(lo|o|d|class|py[co])$|.*~$/ " }}} " Mappings {{{ @@ -471,13 +471,17 @@ filetype *.sqlite,*.db \ sqlite3 %f, " tabular data -filextype *.csv +filextype *.csv, *.xlsx, *.tsv, *.json \ {Open with visidata} \ vd %f, -fileviewer *.csv - \ tidy-viewer +fileviewer *.tsv,*.csv + \ tidy-viewer --color-always --title %c " \ xsv sample 100 %c | xsv table -c8 -p1 -w1, " \ {cat %c | sed -e 's/,,/, ,/g' | column -s, -t | less -#5 -N -S; } +fileviewer *.xlsx + \ xlsx2csv %c | tidy-viewer --color-always --title %c +fileviewer *.json + \ jq '.' --color-output %c " Mindmap filextype *.vym