Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
O
oh-my-fish
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
oh-my-fish
Commits
41383d8b
Commit
41383d8b
authored
May 31, 2015
by
Justin Hileman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[split] Move theme plugin to oh-my-fish/plugin-theme
https://github.com/oh-my-fish/plugin-theme
parent
45c23d04
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
0 additions
and
218 deletions
+0
-218
plugins/theme/README.md
plugins/theme/README.md
+0
-38
plugins/theme/completions/theme.fish
plugins/theme/completions/theme.fish
+0
-4
plugins/theme/spec/theme.spec.fish
plugins/theme/spec/theme.spec.fish
+0
-54
plugins/theme/theme.fish
plugins/theme/theme.fish
+0
-103
plugins/theme/theme.util.get.themes.fish
plugins/theme/theme.util.get.themes.fish
+0
-3
plugins/theme/theme.util.remove.current.fish
plugins/theme/theme.util.remove.current.fish
+0
-16
No files found.
plugins/theme/README.md
deleted
100644 → 0
View file @
45c23d04
## _theme_ :tophat:
> Quick theme switcher.
## Description
Quick theme switcher for _Oh my fish_. _theme_ is smart to auto-complete as you type all the available _oh-my-fish_ themes.

## Options
#### `theme <theme name>`
Quick switch to theme.
#### `theme -l --list`
List available themes.
#### `theme -r --restore`
Restore original theme.
#### `theme -h --help`
Show usage help.
## Authors
+
[
Jorge Bucaran
](
https://github.com/bucaran
)
## Credits
+
Auto-completions thanks to
[
Bruno Pinto
](
https://github.com/bpinto
)
.
## License
MIT
plugins/theme/completions/theme.fish
deleted
100644 → 0
View file @
45c23d04
# Add completions when the theme is loaded. Thanks Bruno!
complete --command (basename -s.fish (status -f)) \
--arguments "(basename (theme.util.get.themes))" \
--description "Oh-my-fish theme"
plugins/theme/spec/theme.spec.fish
deleted
100644 → 0
View file @
45c23d04
import plugins/fish-spec
import plugins/theme
function describe_theme -d "theme: quick theme switcher"
function before_all
set -g __theme_test_last_theme $fish_theme
end
function it_changes_the_current_theme
theme bobthefish
expect $fish_theme --to-equal bobthefish
and expect $fish_function_path --to-contain-all $fish_path/themes/bobthefish
end
function it_restores_the_original_theme
theme bobthefish
theme -r
expect $fish_theme --to-equal $__theme_test_last_theme
end
function it_prints_usage_help
expect (theme -h | grep USAGE | sed -E 's/ //g') --to-equal "USAGE"
end
function it_prints_a_list_of_all_themes
set -l themes (theme -l)
for theme in $fish_custom/themes/* $fish_path/themes/*
set theme (basename "$theme")
expect (echo "$themes" | grep -o "$theme") --to-equal "$theme"
end
end
function it_highlights_the_currently_selected_theme
set -l themes (theme -l)
expect (echo "$themes" | grep -o "$fish_theme\*") --to-equal "$fish_theme*"
end
function it_can_reload_a_theme_multiple_times
theme bobthefish
theme fishface
theme bobthefish
expect $fish_theme --to-equal bobthefish
and expect $fish_function_path --to-contain-all $fish_path/themes/bobthefish
and expect $fish_function_path --to-not-contain-all $fish_path/themes/fishface
end
function it_returns_1_if_the_theme_does_not_exist
set -l improbable_theme ___(date +%s)___
set -l ignore_output (theme "$improbable_theme")
expect $status --to-equal 1
end
end
spec.run $argv
plugins/theme/theme.fish
deleted
100644 → 0
View file @
45c23d04
# NAME
# theme - quick theme switcher
#
# DESCRIPTION
# Quick theme switcher for Oh my fish. theme is smart to auto-complete
# as you type from the list available _oh-my-fish_ themes.
#
# SYNOPSIS
# theme <theme name>
# [-l --list]
# [-u --update]
# [-r --restore]
# [-h --help]
#
# OPTIONS
# theme <theme name>
# Quick switch to theme.
#
# theme -l --list
# List available themes.
#
# theme -u --update
# Update theme auto-completions.
#
# theme -r --restore
# Restore original theme.
#
# theme -h --help
# Show usage help.
#
# AUTHORS
# Jorge Bucaran <jbucaran@me.com>
# /
if not set -q __fish_theme_last
set -g __fish_theme_last $fish_theme
end
function theme -d "quick theme switcher"
set -l usage "
USAGE
$_ <theme name>
Quick switch to theme.
$_ -l --list
List available themes.
$_ -r --restore
Restore original theme.
$_ -h --help
Show usage help.
"
if test (count $argv) -gt 0
set -l option $argv[1]
switch $option
case -h --help help
echo $usage
case -l --list
set -l regex "[[:<:]]($fish_theme)[[:>:]]"
if test (uname) != "Darwin"
set regex "\b($fish_theme)\b"
end
set -l color green
for theme in (theme.util.get.themes)
basename $theme \
| sed -E "s/$regex/"(set_color $color)"\1*"(set_color normal)"/"
end | column
set_color normal
case -r --restore
if set -q __fish_theme_last
if test $__fish_theme_last != $fish_theme
theme.util.remove.current
set fish_theme $__fish_theme_last
. $fish_path/oh-my-fish.fish
end
end
case \*
if test -z "$option"
echo $usage
else if test -d $fish_custom/themes/$option -o \
-d $fish_path/themes/$option
theme.util.remove.current
set fish_theme $option
. $fish_path/oh-my-fish.fish
else
echo (set_color f00)"`$option` is not a theme."(set_color normal) ^&2
theme --list
return 1
end
end
else
theme --list
end
end
plugins/theme/theme.util.get.themes.fish
deleted
100644 → 0
View file @
45c23d04
function theme.util.get.themes
printf "%s\n" $fish_path/themes/*
end
plugins/theme/theme.util.remove.current.fish
deleted
100644 → 0
View file @
45c23d04
function theme.util.remove.current
# Find previously loaded theme index in function path.
set -l index (contains -i -- \
$fish_custom/themes/$fish_theme $fish_function_path)
if test $status -gt 0
# Not a custom theme, try a default theme.
set index (contains -i -- \
$fish_path/themes/$fish_theme $fish_function_path)
end
if test -n "$index"
# So Long, and Thanks for All the Fish.
set -e fish_function_path[$index]
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment