mirror of
https://github.com/oh-my-fish/oh-my-fish
synced 2024-11-03 15:40:32 +00:00
[split] Move clearance theme to oh-my-fish/theme-clearance
https://github.com/oh-my-fish/theme-clearance
This commit is contained in:
parent
f0ee1b9d4d
commit
fee0b1bbb5
@ -1,9 +0,0 @@
|
|||||||
# Fish Theme: clearance
|
|
||||||
|
|
||||||
A minimalist [fish shell](http://fishshell.com/) theme for people who use git
|
|
||||||
|
|
||||||
![clearance theme](https://raw.github.com/cseelus/clearance-fish/master/clearance-fish_preview.png)
|
|
||||||
|
|
||||||
## Like it?
|
|
||||||
|
|
||||||
Check out other versions of this theme for OSX Terminal or VIM!
|
|
Binary file not shown.
Before Width: | Height: | Size: 232 KiB |
@ -1,61 +0,0 @@
|
|||||||
# name: clearance
|
|
||||||
# ---------------
|
|
||||||
# Based on idan. Display the following bits on the left:
|
|
||||||
# - Virtualenv name (if applicable, see https://github.com/adambrenecki/virtualfish)
|
|
||||||
# - Current directory name
|
|
||||||
# - Git branch and dirty state (if inside a git repo)
|
|
||||||
|
|
||||||
function _git_branch_name
|
|
||||||
echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
|
|
||||||
end
|
|
||||||
|
|
||||||
function _git_is_dirty
|
|
||||||
echo (command git status -s --ignore-submodules=dirty ^/dev/null)
|
|
||||||
end
|
|
||||||
|
|
||||||
function fish_prompt
|
|
||||||
set -l last_status $status
|
|
||||||
|
|
||||||
set -l cyan (set_color cyan)
|
|
||||||
set -l yellow (set_color yellow)
|
|
||||||
set -l red (set_color red)
|
|
||||||
set -l blue (set_color blue)
|
|
||||||
set -l green (set_color green)
|
|
||||||
set -l normal (set_color normal)
|
|
||||||
|
|
||||||
set -l cwd $blue(pwd | sed "s:^$HOME:~:")
|
|
||||||
|
|
||||||
# Output the prompt, left to right
|
|
||||||
|
|
||||||
# Add a newline before new prompts
|
|
||||||
echo -e ''
|
|
||||||
|
|
||||||
# Display [venvname] if in a virtualenv
|
|
||||||
if set -q VIRTUAL_ENV
|
|
||||||
echo -n -s (set_color -b cyan black) '[' (basename "$VIRTUAL_ENV") ']' $normal ' '
|
|
||||||
end
|
|
||||||
|
|
||||||
# Print pwd or full path
|
|
||||||
echo -n -s $cwd $normal
|
|
||||||
|
|
||||||
# Show git branch and status
|
|
||||||
if [ (_git_branch_name) ]
|
|
||||||
set -l git_branch (_git_branch_name)
|
|
||||||
|
|
||||||
if [ (_git_is_dirty) ]
|
|
||||||
set git_info '(' $yellow $git_branch "±" $normal ')'
|
|
||||||
else
|
|
||||||
set git_info '(' $green $git_branch $normal ')'
|
|
||||||
end
|
|
||||||
echo -n -s ' · ' $git_info $normal
|
|
||||||
end
|
|
||||||
|
|
||||||
set -l prompt_color $red
|
|
||||||
if test $last_status = 0
|
|
||||||
set prompt_color $normal
|
|
||||||
end
|
|
||||||
|
|
||||||
# Terminate with a nice prompt char
|
|
||||||
echo -e ''
|
|
||||||
echo -e -n -s $prompt_color '⟩ ' $normal
|
|
||||||
end
|
|
Loading…
Reference in New Issue
Block a user