mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-11-22 15:35:43 +08:00
add my custom theme
This commit is contained in:
parent
a735b305bd
commit
3f034f9f36
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
|||
custom/*
|
||||
|
||||
.DS_Store
|
28
themes/l/fish_prompt.fish
Normal file
28
themes/l/fish_prompt.fish
Normal file
|
@ -0,0 +1,28 @@
|
|||
function _git_branch_name
|
||||
echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
|
||||
end
|
||||
|
||||
function _is_git_dirty
|
||||
echo (git status -s --ignore-submodules=dirty ^/dev/null)
|
||||
end
|
||||
|
||||
function fish_prompt
|
||||
set -l blue (set_color blue)
|
||||
set -l green (set_color green)
|
||||
set -l normal (set_color normal)
|
||||
|
||||
set -l arrow "λ"
|
||||
set -l cwd $blue(basename (prompt_pwd))
|
||||
|
||||
if [ (_git_branch_name) ]
|
||||
set git_info $green(_git_branch_name)
|
||||
set git_info ":$git_info"
|
||||
|
||||
if [ (_is_git_dirty) ]
|
||||
set -l dirty "*"
|
||||
set git_info "$git_info$dirty"
|
||||
end
|
||||
end
|
||||
|
||||
echo -n -s $cwd $git_info $normal ' ' $arrow ' '
|
||||
end
|
Loading…
Reference in New Issue
Block a user