aboutsummaryrefslogtreecommitdiff
path: root/conf.d/02platform.fish
diff options
context:
space:
mode:
authorDeposite Pirate2026-02-16 05:55:47 +0100
committerDeposite Pirate2026-02-16 05:55:47 +0100
commitb8b31e59d8116b4c0d9c1329942adf130bffdd18 (patch)
tree6404a24d63a8061efe0e923d96eaa65aada7d7cb /conf.d/02platform.fish
parentcd3f5e493ea8a9c88d82e459d8bbd21dd186a8af (diff)
Clean up inline functions
modified: conf.d/02platform.fish
Diffstat (limited to 'conf.d/02platform.fish')
-rw-r--r--conf.d/02platform.fish51
1 files changed, 30 insertions, 21 deletions
diff --git a/conf.d/02platform.fish b/conf.d/02platform.fish
index 5cbc4cb..91ad54e 100644
--- a/conf.d/02platform.fish
+++ b/conf.d/02platform.fish
@@ -2,7 +2,7 @@ if status is-interactive
## Functions
- function handle_colorls
+ function _handle_colorls
if command -sq colorls
alias ls 'colorls -G -F'
alias ll 'colorls -G -F -l'
@@ -16,7 +16,7 @@ if status is-interactive
end
end
- function handle_eza
+ function _handle_eza
switch $TERM
case 'xterm-256color'
set -f icons 'yes'
@@ -55,7 +55,7 @@ if status is-interactive
### Linux
- function handle_linux
+ function _handle_linux
if command -sq dircolors; and test -f ~/.config/dircolors
eval (dircolors -c ~/.config/dircolors)
@@ -158,11 +158,11 @@ if status is-interactive
alias_if_not nslookup systemd-resolve
end
- end # handle_linux
+ end # _handle_linux
### macOS
- function handle_macos
+ function _handle_macos
if test -d '/opt/homebrew/bin'
fish_add_path --prepend --global --path '/opt/homebrew/bin'
@@ -209,13 +209,13 @@ if status is-interactive
end
end
- end # handle_macos
+ end # _handle_macos
### NetBSD
- function handle_netbsd
+ function _handle_netbsd
- handle_colorls
+ _handle_colorls
alias nproc 'sysctl -n hw.ncpu'
alias free 'vmstat'
@@ -239,13 +239,13 @@ if status is-interactive
alias pkgclean 'doas pkgin clean'
end
- end # handle_netbsd
+ end # _handle_netbsd
### OpenBSD
- function handle_openbsd
+ function _handle_openbsd
- handle_colorls
+ _handle_colorls
alias nproc 'sysctl -n hw.ncpu'
alias free 'vmstat'
@@ -278,11 +278,11 @@ if status is-interactive
pkg_info -q -e "$argv->=0"
end
- end # handle_openbsd
+ end # _handle_openbsd
### FreeBSD
- function handle_freebsd
+ function _handle_freebsd
alias ls 'ls -GF'
alias la 'ls -GF -a'
@@ -316,25 +316,25 @@ if status is-interactive
alias pkgclean 'doas pkg clean -a'
end
- end # handle_freebsd
+ end # _handle_freebsd
switch (uname)
case 'Linux'
- handle_linux
+ _handle_linux
case 'Darwin'
- handle_macos
+ _handle_macos
case 'OpenBSD'
- handle_openbsd
+ _handle_openbsd
case 'NetBSD'
- handle_netbsd
+ _handle_netbsd
case 'FreeBSD'
- handle_freebsd
+ _handle_freebsd
end
## All platforms
if command -sq 'eza'
- handle_eza
+ _handle_eza
else
if command -sq tree
alias lta 'tree -a'
@@ -350,7 +350,7 @@ if status is-interactive
alias_if doas sudo
- # process viewer to look for by order of preference
+ # Process viewer to look for by order of preference
set topprg 'htop' 'btop'
set found_topprg (find_prog $topprg)
@@ -358,4 +358,13 @@ if status is-interactive
alias top "$found_topprg"
end
+ # Cleanup
+ functions -e _handle_eza
+ functions -e _handle_colorls
+ functions -e _handle_linux
+ functions -e _handle_macos
+ functions -e _handle_openbsd
+ functions -e _handle_netbsd
+ functions -e _handle_freebsd
+
end