Vifm: list ignored files with fzf

This commit is contained in:
Akemi Izuko 2024-04-15 18:20:25 -06:00
parent a6854c2227
commit 254e31bff0
Signed by: akemi
GPG key ID: 8DE0764E1809E9FC
4 changed files with 15 additions and 6 deletions

View file

@ -44,6 +44,11 @@ fi
# Stop brew from upgrading all formula when installing something # Stop brew from upgrading all formula when installing something
export HOMEBREW_NO_INSTALL_UPGRADE=1 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 ========================================================== # Swayland ==========================================================
if [[ "$(uname -s)" == "Linux" ]] && pidof sway &>/dev/null; then if [[ "$(uname -s)" == "Linux" ]] && pidof sway &>/dev/null; then
export WAYLAND_DISPLAY=wayland-1 export WAYLAND_DISPLAY=wayland-1

View file

@ -65,6 +65,10 @@ has_tmux () {
command -v tmux &> /dev/null command -v tmux &> /dev/null
} }
not_in_vim () {
[[ -z "$VIMRUNTIME" ]]
}
set_starting_dir () { set_starting_dir () {
if [[ "$PWD" == "$HOME" && -d ~/safe && "$IS_VIFM_NEST" != 'T' ]]; then if [[ "$PWD" == "$HOME" && -d ~/safe && "$IS_VIFM_NEST" != 'T' ]]; then
cd ~/safe cd ~/safe
@ -86,7 +90,7 @@ printf '\n'
set_starting_dir set_starting_dir
# Attach ssh connections to a dedicated tmux session ==== # 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 \ tmux new-session -As ssh_tmux 2>&1 \
| grep -v 'sessions should be nested with care' # We don't care | grep -v 'sessions should be nested with care' # We don't care
fi fi

View file

@ -16,7 +16,7 @@ requires_gui_error() {
} }
open_pdf() { open_pdf() {
zathura "$1" &>/dev/null & zathura "$(sed 's#\\##g' <<<"$1")" &>/dev/null &
} }
open_image() { open_image() {
@ -54,7 +54,7 @@ open_file() {
requires_gui_error requires_gui_error
fi fi
;; ;;
avif|icns|jpeg|jpg|png|webp) avif|icns|jpeg|jpg|png|webp|svg)
if [[ $is_gui ]]; then if [[ $is_gui ]]; then
open_image "$1" open_image "$1"
else else

View file

@ -278,9 +278,9 @@ command! fdeditfiles
command! fdmvcursor command! fdmvcursor
\ :if $TMUX != '' && &columns > 90 && &lines >= 30 \ :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 \ | 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 \ | endif
" Read in latests bookmarks before fzfinding through them " 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 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' if system('uname -s') == 'Darwin'
filetype *.jpg,*.jpeg,*.png,*.icns open -a Preview.app %c:p filetype *.jpg,*.jpeg,*.png,*.icns open -a Preview.app %c:p