From 254e31bff00c301a6062765e43fedf5ea2709446 Mon Sep 17 00:00:00 2001 From: Akemi Izuko Date: Mon, 15 Apr 2024 18:20:25 -0600 Subject: [PATCH] Vifm: list ignored files with fzf --- bash/.bash_env | 5 +++++ bash/.bash_profile | 6 +++++- vifm/scripts/vifm_bg_open.sh | 4 ++-- vifm/vifmrc | 6 +++--- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/bash/.bash_env b/bash/.bash_env index 0873f59..c9f1b72 100644 --- a/bash/.bash_env +++ b/bash/.bash_env @@ -44,6 +44,11 @@ fi # Stop brew from upgrading all formula when installing something export HOMEBREW_NO_INSTALL_UPGRADE=1 +# Node Version Manager ============================================== +if [[ -f /usr/share/nvm/init-nvm.sh ]]; then + source /usr/share/nvm/init-nvm.sh +fi + # Swayland ========================================================== if [[ "$(uname -s)" == "Linux" ]] && pidof sway &>/dev/null; then export WAYLAND_DISPLAY=wayland-1 diff --git a/bash/.bash_profile b/bash/.bash_profile index 40a3b4f..4ef08f7 100644 --- a/bash/.bash_profile +++ b/bash/.bash_profile @@ -65,6 +65,10 @@ has_tmux () { command -v tmux &> /dev/null } +not_in_vim () { + [[ -z "$VIMRUNTIME" ]] +} + set_starting_dir () { if [[ "$PWD" == "$HOME" && -d ~/safe && "$IS_VIFM_NEST" != 'T' ]]; then cd ~/safe @@ -86,7 +90,7 @@ printf '\n' set_starting_dir # Attach ssh connections to a dedicated tmux session ==== -if is_ssh_connection && has_tmux; then +if is_ssh_connection && has_tmux && not_in_vim; then tmux new-session -As ssh_tmux 2>&1 \ | grep -v 'sessions should be nested with care' # We don't care fi diff --git a/vifm/scripts/vifm_bg_open.sh b/vifm/scripts/vifm_bg_open.sh index d1bbc7a..f0aa72e 100755 --- a/vifm/scripts/vifm_bg_open.sh +++ b/vifm/scripts/vifm_bg_open.sh @@ -16,7 +16,7 @@ requires_gui_error() { } open_pdf() { - zathura "$1" &>/dev/null & + zathura "$(sed 's#\\##g' <<<"$1")" &>/dev/null & } open_image() { @@ -54,7 +54,7 @@ open_file() { requires_gui_error fi ;; - avif|icns|jpeg|jpg|png|webp) + avif|icns|jpeg|jpg|png|webp|svg) if [[ $is_gui ]]; then open_image "$1" else diff --git a/vifm/vifmrc b/vifm/vifmrc index 1494521..f8cf364 100644 --- a/vifm/vifmrc +++ b/vifm/vifmrc @@ -278,9 +278,9 @@ command! fdeditfiles command! fdmvcursor \ :if $TMUX != '' && &columns > 90 && &lines >= 30 - \ | exe 'goto "'.system('fd --maxdepth=1 -HE ''.git'' . | fzf-tmux -p 90,30').'"' | navigateIfDir + \ | exe 'goto "'.system('fd --maxdepth=1 -HIE ''.git'' . | fzf-tmux -p 90,30').'"' | navigateIfDir \ | else - \ | exe 'goto "'.term('fd --maxdepth=1 -HE ''.git'' . | fzf 2>/dev/tty').'"' | navigateIfDir + \ | exe 'goto "'.term('fd --maxdepth=1 -HIE ''.git'' . | fzf 2>/dev/tty').'"' | navigateIfDir \ | endif " Read in latests bookmarks before fzfinding through them @@ -328,7 +328,7 @@ endif fileviewer *[^/] env -uCOLORTERM bat --color always --theme ansi --wrap never --pager never %c -p -filetype *.mp4,*.mkv,*.mov,*.webm,*.mp3,*.flac mpv %c +filetype *.mp4,*.mkv,*.mov,*.webm,*.mp3,*.flac,*.wav mpv %c if system('uname -s') == 'Darwin' filetype *.jpg,*.jpeg,*.png,*.icns open -a Preview.app %c:p