32 lines
2.1 KiB
Fish
32 lines
2.1 KiB
Fish
function fish_vars
|
|
# https://fishshell.com/docs/current/language.html#special-variables
|
|
set -l _special_variables FISH_DEBUG FISH_DEBUG_OUTPUT SHLVL fish_ambiguous_width fish_emoji_width fish_autosuggestion_enabled fish_handle_reflow fish_key_bindings fish_escape_delay_ms fish_greeting fish_history fish_trace umask
|
|
set -l _fish_path_variables (set --names | string match '__fish*dir')
|
|
set -l _path_variables PATH CDPATH MANPATH fish_user_paths
|
|
set -l _all_variables $_path_variables $_fish_path_variables $_special_variables
|
|
set -l _table_format "│ %-28s │ %-60s │\n"
|
|
|
|
echo '┌──────────────────────────────┬──────────────────────────────────────────────────────────────┐'
|
|
echo '│ Variable │ Value │'
|
|
echo '├──────────────────────────────┼──────────────────────────────────────────────────────────────┤'
|
|
|
|
for variable in $_all_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
|