29 lines
1.7 KiB
Fish
29 lines
1.7 KiB
Fish
function fish_vars
|
|
set -l _special_variables BROWSER CDPATH LANG PATH SHLVL fish_ambiguous_width fish_emoji_width fish_escape_delay_ms fish_trace fish_user_paths hostname umask version
|
|
set -l _path_variables CDPATH PATH fish_user_paths
|
|
set -l _table_format "│ %-24s │ %-60s │\n"
|
|
|
|
echo '┌──────────────────────────┬──────────────────────────────────────────────────────────────┐'
|
|
echo '│ Variable │ Value │'
|
|
echo '├──────────────────────────┼──────────────────────────────────────────────────────────────┤'
|
|
|
|
for variable in $_special_variables
|
|
if set -q $variable
|
|
if contains -- $variable $_path_variables
|
|
set -l paths $$variable
|
|
printf $_table_format $variable "- $paths[1]"
|
|
for path in $paths[2..-1]
|
|
printf $_table_format "" "- $path"
|
|
end
|
|
else
|
|
printf $_table_format $variable $$variable
|
|
end
|
|
else
|
|
printf $_table_format $variable "<unset>"
|
|
end
|
|
end
|
|
|
|
echo '└──────────────────────────┴──────────────────────────────────────────────────────────────┘'
|
|
|
|
end
|