tree -> exa for previewing directories

This commit is contained in:
FollieHiyuki 2021-03-24 14:51:24 +03:00
parent 1ba97b4a54
commit 1ae7955856
No known key found for this signature in database
GPG Key ID: 813CF484F4993419
9 changed files with 10 additions and 9 deletions

View File

@ -60,7 +60,7 @@ export FZF_DEFAULT_OPTS="--multi --layout=reverse --inline-info
export FZF_DEFAULT_COMMAND="fd --type f --follow --hidden --exclude .git" export FZF_DEFAULT_COMMAND="fd --type f --follow --hidden --exclude .git"
export FZF_CTRL_T_OPTS="--no-height --preview-window 'left:60%' --preview '$HOME/.local/bin/garbage/preview {} 2>/dev/null'" export FZF_CTRL_T_OPTS="--no-height --preview-window 'left:60%' --preview '$HOME/.local/bin/garbage/preview {} 2>/dev/null'"
export FZF_CTRL_T_COMMAND="fd --follow --hidden --exclude .git" export FZF_CTRL_T_COMMAND="fd --follow --hidden --exclude .git"
export FZF_ALT_C_OPTS="--preview 'tree -La 1 -C --dirsfirst {} 2>/dev/null'" export FZF_ALT_C_OPTS="--preview 'exa -1a --color always --icons {} 2>/dev/null'"
export FZF_ALT_C_COMMAND="fd --type d --follow --hidden --exclude .git" export FZF_ALT_C_COMMAND="fd --type d --follow --hidden --exclude .git"
export FZF_TMUX=1 export FZF_TMUX=1
# ibus # ibus

View File

@ -66,7 +66,7 @@ set -gx FZF_DEFAULT_OPTS "--multi --layout=reverse --inline-info
set -gx FZF_DEFAULT_COMMAND "fd --type f --follow --hidden --exclude .git" set -gx FZF_DEFAULT_COMMAND "fd --type f --follow --hidden --exclude .git"
set -gx FZF_CTRL_T_OPTS "--no-height --preview-window 'left:60%' --preview '$HOME/.local/bin/garbage/preview {} 2>/dev/null'" set -gx FZF_CTRL_T_OPTS "--no-height --preview-window 'left:60%' --preview '$HOME/.local/bin/garbage/preview {} 2>/dev/null'"
set -gx FZF_CTRL_T_COMMAND "fd --follow --hidden --exclude .git" set -gx FZF_CTRL_T_COMMAND "fd --follow --hidden --exclude .git"
set -gx FZF_ALT_C_OPTS "--preview 'tree -La 1 -C --dirsfirst {} 2>/dev/null'" set -gx FZF_ALT_C_OPTS "--preview 'exa -1a --color always --icons {} 2>/dev/null'"
set -gx FZF_ALT_C_COMMAND "fd --type d --follow --hidden --exclude .git" set -gx FZF_ALT_C_COMMAND "fd --type d --follow --hidden --exclude .git"
set -gx FZF_TMUX 1 set -gx FZF_TMUX 1
# ibus # ibus

View File

@ -8,7 +8,7 @@
. "$(dirname "$0")"/.nnn-plugin-helper . "$(dirname "$0")"/.nnn-plugin-helper
if [ "$(cmd_exists fzf)" -eq "0" ]; then if [ "$(cmd_exists fzf)" -eq "0" ]; then
sel=$(fd --type d --follow --hidden --exclude .git | fzf --preview 'tree -La 1 -C --dirsfirst {} 2>/dev/null') sel=$(fd --type d --follow --hidden --exclude .git | fzf --preview 'exa -1a --color always --icons {} 2>/dev/null')
else else
exit 1 exit 1
fi fi

View File

@ -34,7 +34,8 @@ case "$1" in
then then
echo "" echo ""
else else
tree "$1" -La 1 -C --dirsfirst echo "\0"
exa -1a --color always --icons "$1"
fi ;; fi ;;
application/zip | application/x-tar | application/x-rar | application/x-7z-compressed | application/x-xz | application/x-bzip2 | application/x-gzip) application/zip | application/x-tar | application/x-rar | application/x-7z-compressed | application/x-xz | application/x-bzip2 | application/x-gzip)
atool -l -q "$1" | tail -n +3 | awk -F' ' '{print $NF}' ;; atool -l -q "$1" | tail -n +3 | awk -F' ' '{print $NF}' ;;

View File

@ -151,7 +151,7 @@ command! fzf : let $FZF_RES = term('fzf --preview-window left --preview "$HOME/.
\| endif \| endif
" fzf dir " fzf dir
command! fzd : let $FZF_RES = term('fd --type d --follow --hidden --exclude .git | fzf --preview "tree -La 1 -C --dirsfirst {} 2>/dev/null" 2> /dev/tty') command! fzd : let $FZF_RES = term('fd --type d --follow --hidden --exclude .git | fzf --preview "exa -1a --color always --icons {} 2>/dev/null" 2> /dev/tty')
\| if $FZF_RES != '' \| if $FZF_RES != ''
\| cd $FZF_RES \| cd $FZF_RES
\| endif \| endif

View File

@ -56,7 +56,7 @@ export FZF_DEFAULT_OPTS="--multi --layout=reverse --inline-info
export FZF_DEFAULT_COMMAND="fd --type f --follow --hidden --exclude .git" export FZF_DEFAULT_COMMAND="fd --type f --follow --hidden --exclude .git"
export FZF_CTRL_T_OPTS="--no-height --preview-window 'left:60%' --preview '$HOME/.local/bin/garbage/preview {} 2>/dev/null'" export FZF_CTRL_T_OPTS="--no-height --preview-window 'left:60%' --preview '$HOME/.local/bin/garbage/preview {} 2>/dev/null'"
export FZF_CTRL_T_COMMAND="fd --follow --hidden --exclude .git" export FZF_CTRL_T_COMMAND="fd --follow --hidden --exclude .git"
export FZF_ALT_C_OPTS="--preview 'tree -La 1 -C --dirsfirst {} 2>/dev/null'" export FZF_ALT_C_OPTS="--preview 'exa -1a --color always --icons {} 2>/dev/null'"
export FZF_ALT_C_COMMAND="fd --type d --follow --hidden --exclude .git" export FZF_ALT_C_COMMAND="fd --type d --follow --hidden --exclude .git"
export FZF_TMUX=1 export FZF_TMUX=1
# ibus # ibus

View File

@ -75,7 +75,7 @@ E:FZF_DEFAULT_OPTS = "--multi --layout=reverse --inline-info
E:FZF_DEFAULT_COMMAND = "fd --type f --follow --hidden --exclude .git" E:FZF_DEFAULT_COMMAND = "fd --type f --follow --hidden --exclude .git"
E:FZF_CTRL_T_OPTS = "--no-height --preview-window 'left:60%' --preview '$HOME/.local/bin/garbage/preview {} 2>/dev/null'" E:FZF_CTRL_T_OPTS = "--no-height --preview-window 'left:60%' --preview '$HOME/.local/bin/garbage/preview {} 2>/dev/null'"
E:FZF_CTRL_T_COMMAND = "fd --follow --hidden --exclude .git" E:FZF_CTRL_T_COMMAND = "fd --follow --hidden --exclude .git"
E:FZF_ALT_C_OPTS = "--preview 'tree -La 1 -C --dirsfirst {} 2>/dev/null'" E:FZF_ALT_C_OPTS = "--preview 'exa -1a --color always --icons {} 2>/dev/null'"
E:FZF_ALT_C_COMMAND = "fd --type d --follow --hidden --exclude .git" E:FZF_ALT_C_COMMAND = "fd --type d --follow --hidden --exclude .git"
E:FZF_TMUX = 1 E:FZF_TMUX = 1
# ibus # ibus

View File

@ -74,7 +74,7 @@ case "$1" in
mimetype=$(file --dereference --brief --mime-type -- "$1") mimetype=$(file --dereference --brief --mime-type -- "$1")
case "$mimetype" in case "$mimetype" in
inode/directory) inode/directory)
tree "$1" -La 1 -C --dirsfirst ;; exa -1a --color always --icons "$1" ;;
application/zip|application/x-tar|application/x-gzip) application/zip|application/x-tar|application/x-gzip)
atool -l -q "$1" | tail -n +3 | awk -F' ' '{print $NF}' ;; atool -l -q "$1" | tail -n +3 | awk -F' ' '{print $NF}' ;;
image/vnd.djvu) image/vnd.djvu)

View File

@ -29,7 +29,7 @@ case "$1" in
mimetype=$(file --dereference --brief --mime-type -- "$1") mimetype=$(file --dereference --brief --mime-type -- "$1")
case "$mimetype" in case "$mimetype" in
inode/directory) inode/directory)
tree -La 1 -C --dirsfirst "$1" ;; exa -1a --color always --icons "$1" ;;
application/zip|application/x-tar|application/x-gzip) application/zip|application/x-tar|application/x-gzip)
atool -l -q "$1" | tail -n +3 | awk -F' ' '{print $NF}' ;; atool -l -q "$1" | tail -n +3 | awk -F' ' '{print $NF}' ;;
image/vnd.djvu) image/vnd.djvu)