fish: snazzy border for fish_vars and fish_colors
This commit is contained in:
parent
3a5b050993
commit
3c75058dd8
@ -14,18 +14,19 @@ function fish_colors --description 'Print the fish color variables'
|
|||||||
set -l normal (set_color normal)
|
set -l normal (set_color normal)
|
||||||
set -l bold (set_color --bold)
|
set -l bold (set_color --bold)
|
||||||
|
|
||||||
printf "\n| %-32s | %-38s | %-22s |\n" Variable Definition Example
|
echo '┌──────────────────────────────────┬────────────────────────────────────────┬────────────────────────┐'
|
||||||
echo '|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|'
|
echo '│ Variable │ Definition │ Example │'
|
||||||
|
echo '├──────────────────────────────────┼────────────────────────────────────────┼────────────────────────┤'
|
||||||
for variable in $color_list
|
for variable in $color_list
|
||||||
set -l value $$variable
|
set -l value $$variable
|
||||||
set -l color (set_color $value 2>/dev/null)
|
set -l color (set_color $value 2>/dev/null)
|
||||||
or begin
|
or begin
|
||||||
printf "| %-32s | %s%-38s | %-22s |\n" "$variable" (set_color --bold white --background=red) "$value" "The quick brown fox..."
|
printf "│ %-32s │ %s%-38s │ %-22s │\n" "$variable" (set_color --bold white --background=red) "$value" "The quick brown fox..."
|
||||||
continue
|
continue
|
||||||
end
|
end
|
||||||
printf "| $normal%-32s | $bold%-38s$normal | $color%-22s$normal |\n" "$variable" "$value" "The quick brown fox..."
|
printf "│ $normal%-32s │ $bold%-38s$normal │ $color%-22s$normal │\n" "$variable" "$value" "The quick brown fox..."
|
||||||
end
|
end
|
||||||
echo '|__________________________________|________________________________________|________________________|'\n
|
echo '└──────────────────────────────────┴────────────────────────────────────────┴────────────────────────┘'
|
||||||
end
|
end
|
||||||
|
|
||||||
if contains -- '-g' $argv; or contains -- '--global' $argv
|
if contains -- '-g' $argv; or contains -- '--global' $argv
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
function fish_vars
|
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 _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 _path_variables CDPATH PATH fish_user_paths
|
||||||
set -l _table_format "| %-24s | %-38s |\n"
|
set -l _table_format "│ %-24s │ %-60s │\n"
|
||||||
|
|
||||||
printf "\n$_table_format" Variable Value
|
echo '┌──────────────────────────┬──────────────────────────────────────────────────────────────┐'
|
||||||
|
echo '│ Variable │ Value │'
|
||||||
printf $_table_format (printf "%.s¯" (seq 24)) (printf "%.s¯" (seq 38))
|
echo '├──────────────────────────┼──────────────────────────────────────────────────────────────┤'
|
||||||
|
|
||||||
for variable in $_special_variables
|
for variable in $_special_variables
|
||||||
if set -q $variable
|
if set -q $variable
|
||||||
@ -23,6 +23,6 @@ function fish_vars
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
printf $_table_format (printf "%.s_" (seq 24)) (printf "%.s_" (seq 38))
|
echo '└──────────────────────────┴──────────────────────────────────────────────────────────────┘'
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user