From b3c7edb5042deebdb66345b3b4839dc6f004782a Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Sat, 30 May 2026 23:27:06 -0400 Subject: [PATCH] =?UTF-8?q?add=20xnd=20(duckdb=E2=86=92vd),=20visidatarc?= =?UTF-8?q?=20with=20comma=20formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 (1M context) --- _lib.sh | 2 +- dotfiles/.bashrc | 18 ++++++++++++++++++ dotfiles/.visidatarc | 2 ++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 dotfiles/.visidatarc diff --git a/_lib.sh b/_lib.sh index d6ebb1d..ef45e6e 100755 --- a/_lib.sh +++ b/_lib.sh @@ -44,7 +44,7 @@ deploy_configs() { echo "Deploying configuration files as symlinks..." local config_dir="$SCRIPT_DIR/dotfiles" - for config in .bashrc .vimrc .gitconfig .pspgconf .psqlrc .tmux.conf; do + for config in .bashrc .vimrc .gitconfig .pspgconf .psqlrc .tmux.conf .visidatarc; do create_symlink "$config_dir/$config" ~/"$config" done diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc index c3610f7..6daeb18 100644 --- a/dotfiles/.bashrc +++ b/dotfiles/.bashrc @@ -179,6 +179,24 @@ xnspa() { -f "$file" | vd -f csv - } +xnd() { + local file + + file=$( + lsof +D ~/.local/state/nvim/swap/ 2>/dev/null | grep -v 'lsof:' | + grep -o "/swap/.*" | + sed 's|^/swap/||' | + tr "%" "/" | + sed -E 's/\.sw[op]$//' | + grep "$(pwd | sed 's|^//|/|')" | + fzf + ) || return + + [[ -z "$file" ]] && return + + duckdb -csv /opt/sync/osm_stack.duckdb < "$file" | vd -f csv - +} + xndb2() { local file candidates diff --git a/dotfiles/.visidatarc b/dotfiles/.visidatarc new file mode 100644 index 0000000..2e1aa9c --- /dev/null +++ b/dotfiles/.visidatarc @@ -0,0 +1,2 @@ +options.disp_float_fmt = '{:,.2f}' +options.disp_int_fmt = '{:,}'