Replace exa with eza

This commit is contained in:
gardouille 2023-09-16 07:33:24 +02:00
parent 1f60d19191
commit f58f1f0592
Signed by: gardouille
GPG Key ID: E759BAA22501AF32
1 changed files with 16 additions and 15 deletions

31
zshrc
View File

@ -24,7 +24,7 @@ alias mv='mv --interactive'
alias rm='rm --interactive'
# ls shortcut {{{
if [ ! $(command -v exa) ]; then
if [ ! $(command -v eza) ]; then
## with ls {{{
alias ll='ls -l'
## Show hidden files
@ -41,9 +41,10 @@ if [ ! $(command -v exa) ]; then
alias lld='ls -l --directory */ --human-readable'
alias lr='ls --recursive | grep ":$" | sed -e '\''s/:$//'\'' -e '\''s/[^-][^\/]*\//--/g'\'' -e '\''s/^/ /'\'' -e '\''s/-/|/'\'''
## }}}
## with exa {{{
## with eza (forked from exa) {{{
else
alias ll='exa --color=always --long --group --git'
alias exa=eza
alias ll='eza --color=always --long --group --git'
## Show hidden files
alias la='ll --all --sort .name'
## Show hidden only
@ -2086,10 +2087,10 @@ ff() {
## Manage argument {{{
if [ "${#}" -eq "0" ]; then
## Default command without args
dir=$(find . -xtype d -not -path "*/.*" | fzf --prompt='cd> ' --height=50% --preview 'exa --tree --level 2 {} | head --lines=20' --no-multi) &&
dir=$(find . -xtype d -not -path "*/.*" | fzf --prompt='cd> ' --height=50% --preview 'eza --tree --level 2 {} | head --lines=20' --no-multi) &&
else
## If at least one argument was given, add it to fzf query
dir=$(find . -xtype d -not -path "*/.*" | fzf --prompt='cd> ' --height=50% --preview 'exa --tree --level 2 {} | head --lines=20' --no-multi --query "${*} ") &&
dir=$(find . -xtype d -not -path "*/.*" | fzf --prompt='cd> ' --height=50% --preview 'eza --tree --level 2 {} | head --lines=20' --no-multi --query "${*} ") &&
fi
## }}}
@ -2108,10 +2109,10 @@ ffh() {
## Manage argument {{{
if [ "${#}" -eq "0" ]; then
## Default command without args
dir=$(find . -xtype d -path "*/.*" | fzf --prompt='cd> ' --height=50% --preview 'exa --tree --level 2 {} | head --lines=20' --no-multi) &&
dir=$(find . -xtype d -path "*/.*" | fzf --prompt='cd> ' --height=50% --preview 'eza --tree --level 2 {} | head --lines=20' --no-multi) &&
else
## If at least one argument was given, add it to fzf query
dir=$(find . -xtype d -path "*/.*" | fzf --prompt='cd> ' --height=50% --preview 'exa --tree --level 2 {} | head --lines=20' --no-multi --query "${*} ") &&
dir=$(find . -xtype d -path "*/.*" | fzf --prompt='cd> ' --height=50% --preview 'eza --tree --level 2 {} | head --lines=20' --no-multi --query "${*} ") &&
fi
## }}}
@ -2130,10 +2131,10 @@ ffa() {
## Manage argument {{{
if [ "${#}" -eq "0" ]; then
## Default command without args
dir=$(fd -uu --search-path / --type d --type symlink | fzf --prompt='cd> ' --height=50% --preview 'exa --tree --level 1 {} | head --lines=20' --no-multi) &&
dir=$(fd -uu --search-path / --type d --type symlink | fzf --prompt='cd> ' --height=50% --preview 'eza --tree --level 1 {} | head --lines=20' --no-multi) &&
else
## If at least one argument was given, add it to fzf query
dir=$(fd -uu --search-path / --type d --type symlink | fzf --prompt='cd> ' --height=50% --preview 'exa --tree --level 1 {} | head --lines=20' --no-multi --query "${*} ") &&
dir=$(fd -uu --search-path / --type d --type symlink | fzf --prompt='cd> ' --height=50% --preview 'eza --tree --level 1 {} | head --lines=20' --no-multi --query "${*} ") &&
fi
## }}}
@ -2172,7 +2173,7 @@ ffu() {
# Search with fd (after few tests, fdfind is fareway better than find… even on small tree)
# Check for symlinked files too
# Allow to give arguments to prefill fzf request
# Display a directory preview tree of the selected file with exa
# Display a directory preview tree of the selected file with eza
# Move to the directory of the selected file
fff() {
local file
@ -2181,10 +2182,10 @@ fff() {
## Manage argument {{{
if [ "${#}" -eq "0" ]; then
## Default command without args
file=$(fd -uu --type file --type symlink | fzf --prompt='cd> ' --height=50% --preview 'exa --tree --level 2 $(dirname {}) | head --lines=20' --no-multi) &&
file=$(fd -uu --type file --type symlink | fzf --prompt='cd> ' --height=50% --preview 'eza --tree --level 2 $(dirname {}) | head --lines=20' --no-multi) &&
else
## If at least one argument was given, add it to fzf query
file=$(fd -uu --type file --type symlink | fzf --prompt='cd> ' --height=50% --preview 'exa --tree --level 2 $(dirname {}) | head --lines=20' --no-multi --query "${*} ") &&
file=$(fd -uu --type file --type symlink | fzf --prompt='cd> ' --height=50% --preview 'eza --tree --level 2 $(dirname {}) | head --lines=20' --no-multi --query "${*} ") &&
fi
## }}}
@ -2195,7 +2196,7 @@ fff() {
# cf - fuzzy cd from anywhere {{{
# Search with fd (fdfind is perfect to search on /)
# Allow to give arguments to prefill fzf request
# Display a directory preview tree of the selected file with exa
# Display a directory preview tree of the selected file with eza
# Move to the directory of the selected file
cf() {
local file
@ -2203,10 +2204,10 @@ cf() {
## Manage argument {{{
if [ "${#}" -eq "0" ]; then
## Default command without args
file=$(fd -uu --search-path / | fzf --prompt='cd> ' --height=50% --preview 'exa --tree --level 1 $(dirname {}) | head --lines=20' --no-multi) &&
file=$(fd -uu --search-path / | fzf --prompt='cd> ' --height=50% --preview 'eza --tree --level 1 $(dirname {}) | head --lines=20' --no-multi) &&
else
## If at least one argument was given, add it to fzf query
file=$(fd -uu --search-path / | fzf --prompt='cd> ' --height=50% --preview 'exa --tree --level 1 $(dirname {}) | head --lines=20' --no-multi --query "${*} ") &&
file=$(fd -uu --search-path / | fzf --prompt='cd> ' --height=50% --preview 'eza --tree --level 1 $(dirname {}) | head --lines=20' --no-multi --query "${*} ") &&
fi
## }}}