Skip to content

Commit 2373b81

Browse files
committed
feat: use duf as alias for df
1 parent 81eacca commit 2373b81

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
function df
2+
if test $argv
3+
set last_arg $argv[-1]
4+
if test -e "$last_arg"
5+
duf "$last_arg"
6+
return
7+
end
8+
end
9+
10+
duf
11+
end

Configs/.zshenv

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,14 @@ _fuzzy_edit_search_file() {
195195
fi
196196
}
197197

198+
_df() {
199+
if [[ $# -ge 1 && -e "${@: -1}" ]]; then
200+
duf "${@: -1}"
201+
else
202+
duf
203+
fi
204+
}
205+
198206
function _load_post_init() {
199207
#! Never load time consuming functions here
200208
_load_persistent_aliases
@@ -292,7 +300,8 @@ function _load_if_terminal {
292300
mkdir='mkdir -p' \
293301
ffec='_fuzzy_edit_search_file_content' \
294302
ffcd='_fuzzy_change_directory' \
295-
ffe='_fuzzy_edit_search_file'
303+
ffe='_fuzzy_edit_search_file' \
304+
df='_df'
296305

297306
# Some binds won't work on first prompt when deferred
298307
bindkey '\e[H' beginning-of-line

Scripts/pkg_core.lst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ fzf # Command-line fuzzy find
7777
eza|zsh # file lister for zsh
7878
zsh-theme-powerlevel10k-git|zsh # Powerlevel10k is a theme for Zsh. It emphasizes speed, flexibility and out-of-the-box experience.
7979
starship|zsh # customizable shell prompt written in Rust
80+
duf|zsh # prettier version of df for zsh
8081
# starship-git # The cross-shell prompt for astronauts
8182
eza|fish # file lister for fish
8283
starship|fish # customizable shell prompt
84+
duf|fish # prettier version of df for fish
8385
fastfetch # system information fetch tool
8486

8587
# --------------------------------------------------- // HyDE

0 commit comments

Comments
 (0)