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
59ada029
Commit
59ada029
authored
Jul 15, 2014
by
Bruno Pinto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #179 from ngroup/master
parents
eefe9f29
e2015c11
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
108 additions
and
0 deletions
+108
-0
themes/ocean/README.md
themes/ocean/README.md
+26
-0
themes/ocean/fish_prompt.fish
themes/ocean/fish_prompt.fish
+82
-0
No files found.
themes/ocean/README.md
0 → 100644
View file @
59ada029
## ocean
A fish theme with ocean in mind.

Unicode-compatible fonts and terminals is required.
I would recommend iTerm2 + Solarized Dark for Mac users.
This theme is based loosely on
[
agnoster
](
https://gist.github.com/agnoster/3712874
)
#### Characteristics
*
Show a radioactive symbol (☢) when gain the root privileges (It's dangerous!)
*
Current python virtualenv (if applicable)
*
The anchor (⚓) turns red if the previous command failed
*
Full path of current working directory
*
Show the Git branch and dirty state (if applicable)
*
Show
**User@Hostname**
if user is not the default user. Set the following two lines in your config.fish to turn on this feature:
```
fish
set -g theme display_user yes
set -g default_user your_default_username
```
themes/ocean/fish_prompt.fish
0 → 100644
View file @
59ada029
# name: ocean
# A fish theme with ocean in mind.
## Set this options in your config.fish (if you want to)
# set -g theme_display_user yes
# set -g default_user default_username
set __oceanfish_glyph_anchor \u2693
set __oceanfish_glyph_flag \u2691
set __oceanfish_glyph_radioactive \u2622
function _git_branch_name
echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end
function _is_git_dirty
echo (command git status -s --ignore-submodules=dirty ^/dev/null)
end
function fish_prompt
set -l last_status $status
set -l magenta (set_color magenta)
set -l red (set_color red)
set -l cyan (set_color cyan)
set -l white (set_color white)
set -l black (set_color black)
set -l bg_blue (set_color -b blue)
set -l bg_cyan (set_color -b cyan)
set -l bg_white (set_color -b white)
set -l bg_red (set_color -b red)
set -l bg_yellow (set_color -b yellow)
set -l normal (set_color normal)
set -l cwd $white(prompt_pwd)
set -l uid (id -u $USER)
# Show a yellow radioactive symbol for root privileges
if [ $uid -eq 0 ]
echo -n -s $bg_yellow $black " $__oceanfish_glyph_radioactive " $normal
end
# Display virtualenv name if in a virtualenv
if set -q VIRTUAL_ENV
echo -n -s $bg_cyan $black " " (basename "$VIRTUAL_ENV") " " $normal
end
# Show a nice anchor (turns red if previous command failed)
if test $last_status -ne 0
echo -n -s $bg_red $white " $__oceanfish_glyph_anchor " $normal
else
echo -n -s $bg_blue $white " $__oceanfish_glyph_anchor " $normal
end
if [ "$theme_display_user" = "yes" ]
if [ "$USER" != "$default_user" -o -n "$SSH_CLIENT" ]
echo -n -s $bg_white $cyan " " (whoami) "@" (hostname -s) " " $normal
end
end
# Display current path
echo -n -s $bg_cyan " $cwd " $normal
# Show git branch and dirty state
if [ (_git_branch_name) ]
set -l git_branch (_git_branch_name)
if [ (_is_git_dirty) ]
echo -n -s $bg_white $magenta " $git_branch " $red "$__oceanfish_glyph_flag " $normal
else
echo -n -s $bg_white $magenta " $git_branch " $normal
end
end
# Terminate with a space
echo -n -s ' ' $normal
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