mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-02-21 10:30:27 +08:00
Merge pull request #127 from vincent-psarga/master
This commit is contained in:
commit
9f7459b740
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@ custom/*
|
||||
|
||||
.DS_Store
|
||||
*.pyc
|
||||
*~
|
||||
|
12
themes/bira/README.md
Normal file
12
themes/bira/README.md
Normal file
@ -0,0 +1,12 @@
|
||||
## bira
|
||||
|
||||
Theme imported from Oh my ZSH: https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/bira.zsh-theme
|
||||
Contains traces of nuts and code from other Oh my fish themes.
|
||||
|
||||
Display username, hostname, current path and git status. Display the latest error status in the right prompt.
|
||||
|
||||

|
||||
|
||||
TODO:
|
||||
- display Ruby version
|
||||
- display Python version
|
55
themes/bira/fish_prompt.fish
Normal file
55
themes/bira/fish_prompt.fish
Normal file
@ -0,0 +1,55 @@
|
||||
# Theme based on Bira theme from oh-my-zsh: https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/bira.zsh-theme
|
||||
# Some code stolen from oh-my-fish clearance theme: https://github.com/bpinto/oh-my-fish/blob/master/themes/clearance/
|
||||
|
||||
function __user_host
|
||||
set -l content
|
||||
if [ (id -u) = "0" ];
|
||||
echo -n (set_color --bold red)
|
||||
else
|
||||
echo -n (set_color --bold green)
|
||||
end
|
||||
echo -n $USER@(hostname|cut -d . -f 1) (set color normal)
|
||||
end
|
||||
|
||||
function __current_path
|
||||
echo -n (set_color --bold blue) (pwd) (set_color normal)
|
||||
end
|
||||
|
||||
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 __git_status
|
||||
if [ (_git_branch_name) ]
|
||||
set -l git_branch (_git_branch_name)
|
||||
|
||||
if [ (_git_is_dirty) ]
|
||||
set git_info '<'$git_branch"*"'>'
|
||||
else
|
||||
set git_info '<'$git_branch'>'
|
||||
end
|
||||
|
||||
echo -n (set_color yellow) $git_info (set_color normal)
|
||||
end
|
||||
end
|
||||
|
||||
function fish_prompt
|
||||
echo -n (set_color white)"╭─"(set_color normal)
|
||||
__user_host
|
||||
__current_path
|
||||
__git_status
|
||||
echo -e ''
|
||||
echo (set_color white)"╰─"(set_color --bold white)"\$ "(set_color normal)
|
||||
end
|
||||
|
||||
function fish_right_prompt
|
||||
set -l st $status
|
||||
|
||||
if [ $st != 0 ];
|
||||
echo (set_color red) ↵ $st(set_color normal)
|
||||
end
|
||||
end
|
BIN
themes/bira/screenshot.png
Normal file
BIN
themes/bira/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
Loading…
x
Reference in New Issue
Block a user