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 = '{:,}'