From 3f034f9f36798aa315bda4079f7f8fb1d05cae56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Sun, 13 Jan 2013 16:49:28 +0000 Subject: [PATCH] add my custom theme --- .gitignore | 2 ++ themes/l/fish_prompt.fish | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 themes/l/fish_prompt.fish diff --git a/.gitignore b/.gitignore index 6dd9bdd..9de4023 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ custom/* + +.DS_Store \ No newline at end of file diff --git a/themes/l/fish_prompt.fish b/themes/l/fish_prompt.fish new file mode 100644 index 0000000..43fc36c --- /dev/null +++ b/themes/l/fish_prompt.fish @@ -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 \ No newline at end of file