mirror of
https://github.com/oh-my-fish/oh-my-fish
synced 2024-11-03 15:40:32 +00:00
[split] Move nai theme to oh-my-fish/theme-nai
https://github.com/oh-my-fish/theme-nai
This commit is contained in:
parent
c92c2c659d
commit
f83308031e
@ -1,11 +0,0 @@
|
|||||||
## nai
|
|
||||||
A minimalist fish theme which displays git branch and status information.
|
|
||||||
|
|
||||||
![nai](https://cloud.githubusercontent.com/assets/1272018/5961225/116d0a7a-a7d3-11e4-88a6-43da003ddc6c.png)
|
|
||||||
|
|
||||||
#### Characteristics
|
|
||||||
|
|
||||||
##### Left Prompt
|
|
||||||
|
|
||||||
* Truncated CWD (just the current folder name)
|
|
||||||
* Git branch and dirty state (if applicable)
|
|
@ -1,38 +0,0 @@
|
|||||||
# name: nai
|
|
||||||
# Display the following bits on the left:
|
|
||||||
# * 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_dirty
|
|
||||||
echo (command git status -s --ignore-submodules=dirty ^/dev/null)
|
|
||||||
end
|
|
||||||
|
|
||||||
function fish_prompt
|
|
||||||
set -l yellow (set_color yellow)
|
|
||||||
set -l green (set_color green)
|
|
||||||
set -l normal (set_color normal)
|
|
||||||
|
|
||||||
set -l cwd (basename (prompt_pwd))
|
|
||||||
|
|
||||||
echo -e ""
|
|
||||||
|
|
||||||
echo -n -s ' ' $cwd $normal
|
|
||||||
|
|
||||||
if [ (_git_branch_name) ]
|
|
||||||
set -l git_branch (_git_branch_name)
|
|
||||||
|
|
||||||
if [ (_git_dirty) ]
|
|
||||||
set git_info $yellow $git_branch
|
|
||||||
else
|
|
||||||
set git_info $green $git_branch
|
|
||||||
end
|
|
||||||
echo -n -s ' ' $git_info $normal
|
|
||||||
end
|
|
||||||
|
|
||||||
echo -n -s ' ' $normal
|
|
||||||
|
|
||||||
end
|
|
Loading…
Reference in New Issue
Block a user