mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-01-23 11:47:46 +08:00
'omf theme' now lists installed and other available themes separately.
Headings are underlined. Current theme is highlighted in the Installed category.
This commit is contained in:
parent
4e279f93f9
commit
c5670bb9ee
15
pkg/omf/omf.fish
Normal file → Executable file
15
pkg/omf/omf.fish
Normal file → Executable file
|
@ -21,6 +21,10 @@ function omf::dim
|
|||
set_color $fish_color_autosuggestion ^/dev/null; or set_color 555
|
||||
end
|
||||
|
||||
function omf::under
|
||||
set_color --underline
|
||||
end
|
||||
|
||||
function omf::err
|
||||
set_color $fish_color_error ^/dev/null; or set_color red --bold
|
||||
end
|
||||
|
@ -119,13 +123,14 @@ function omf -d "Oh My Fish"
|
|||
|
||||
case "t" "theme"
|
||||
if test (count $argv) -eq 1
|
||||
set -l ostype (uname)
|
||||
set -l theme (cat $OMF_CONFIG/theme)
|
||||
set -l regex "[[:<:]]($theme)[[:>:]]"
|
||||
test "$ostype" != "Darwin"; and set regex "\b($theme)\b"
|
||||
set -l highlight_current "(^|[[:space:]])($theme)([[:space:]]|\$)"
|
||||
|
||||
omf.packages.list --database --theme | column | sed -E "s/$regex/"(omf::em)"\1"(omf::off)"/"
|
||||
omf::off
|
||||
echo (omf::under)"Installed:"(omf::off)
|
||||
omf.packages.list --installed --theme | column | sed -E s/"$highlight_current"/"\1"(omf::em)"\2"(omf::off)"\3"/g
|
||||
echo
|
||||
echo (omf::under)"Available:"(omf::off)
|
||||
omf.packages.list --available --theme | column
|
||||
else if test (count $argv) -eq 2
|
||||
omf.theme $argv[2]
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue
Block a user