Add nai theme.

This commit is contained in:
Aaron Hamilton 2015-01-29 16:03:34 +00:00 committed by Bruno Pinto
parent 821043513e
commit 0a3911066f
2 changed files with 48 additions and 0 deletions

10
themes/nai/README.md Normal file
View File

@ -0,0 +1,10 @@
## nai
A minimalist fish theme which displays git branch and status information.
#### Characteristics
##### Left Prompt
* Truncated CWD (just the current folder name)
* Git branch and dirty state (if applicable)

View File

@ -0,0 +1,38 @@
# 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