mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-01-21 21:32:01 +08:00
[split] Move fisk theme to oh-my-fish/theme-fisk
https://github.com/oh-my-fish/theme-fisk
This commit is contained in:
parent
5bce07cfd8
commit
ee05364895
|
@ -1,12 +0,0 @@
|
|||
# Fisk
|
||||
|
||||
![theme screenshot](https://cloud.githubusercontent.com/assets/20814/6209746/60949aa6-b5c9-11e4-8edc-5a8e370f4527.png)
|
||||
|
||||
A nice dark blue-green theme with support for:
|
||||
|
||||
- Last exit code
|
||||
- Current git HEAD
|
||||
- Current python virtualenv
|
||||
|
||||
By [joar](https://github.com/joar), thanks to
|
||||
[adisbladis](https://github.com/adisbladis) for the starting point.
|
|
@ -1,5 +0,0 @@
|
|||
function _fisk_concat
|
||||
for i in $argv
|
||||
echo -n $i;
|
||||
end
|
||||
end
|
|
@ -1,56 +0,0 @@
|
|||
function fish_prompt --description 'Write out the prompt'
|
||||
set last_ret $status
|
||||
|
||||
# Palette
|
||||
set -l base01 55f
|
||||
set -l base02 55a
|
||||
set -l base03 777
|
||||
|
||||
set -l c_error f77
|
||||
set -l c_success 7f7
|
||||
|
||||
set -l c_yellow ff5
|
||||
set -l c_magenta f0d
|
||||
|
||||
# Just calculate these once, to save a few cycles when displaying the prompt
|
||||
if not set -q __fish_prompt_hostname
|
||||
set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
|
||||
end
|
||||
|
||||
if not set -q __fish_prompt_cwd
|
||||
set -g __fish_prompt_cwd (set_color $fish_color_cwd)
|
||||
end
|
||||
|
||||
if set -q VIRTUAL_ENV
|
||||
set venv (_fisk_concat " " (set_color $c_magenta) "(" (basename "$VIRTUAL_ENV") ")" (set_color normal))
|
||||
else
|
||||
set venv ""
|
||||
end
|
||||
|
||||
set ret_color $c_success
|
||||
|
||||
if test $last_ret -gt 0
|
||||
set ret_color $c_error
|
||||
end
|
||||
|
||||
set -l ret_part (_fisk_concat \
|
||||
(set_color $base03) '[' \
|
||||
(set_color $ret_color) $last_ret \
|
||||
(set_color $base03) ']' \
|
||||
)
|
||||
|
||||
set -l user_part (_fisk_concat \
|
||||
(set_color $base01) $USER \
|
||||
(set_color $base02) @ \
|
||||
(set_color $base01) $__fish_prompt_hostname \
|
||||
)
|
||||
|
||||
# Virtualenv, git, &c.
|
||||
set -l context_part (_fisk_concat \
|
||||
$__fish_prompt_cwd (prompt_pwd) $venv (set_color -o $c_yellow) (__fish_git_prompt) \
|
||||
)
|
||||
|
||||
set -l prompt_end (_fisk_concat (set_color $base01) '➞')
|
||||
|
||||
echo -n (_fisk_concat $ret_part " " $user_part " " $context_part " " $prompt_end (set_color normal) " ")
|
||||
end
|
Loading…
Reference in New Issue
Block a user