From 1096fab4974ea63415ec8fec0ac815593eeda611 Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Fri, 3 Feb 2017 15:01:15 -0500 Subject: [PATCH] Add fish configuration functions --- bash_aliases | 1 - config/config.fish | 3 +++ config/fish/functions/adg.fish | 4 ++++ config/fish/functions/fish_prompt.fish | 31 ++++++++++++++++++++++++++ gitignore | 1 + 5 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 config/config.fish create mode 100644 config/fish/functions/adg.fish create mode 100644 config/fish/functions/fish_prompt.fish diff --git a/bash_aliases b/bash_aliases index f028d93..ad5d343 100644 --- a/bash_aliases +++ b/bash_aliases @@ -12,7 +12,6 @@ alias deploy_all="fab -R silver-web deploy:master && fab -R gold-web deploy:mas alias deploy_all_migration="fab -R silver-web deploy:master,1 && fab -R gold-web deploy:master,1 && fab -R jupyter deploy_jupyter & fab --parallel avail_staging_hosts deploy:master,1" alias aenv='env | sort | grep ADDGENE' alias sl='source local.env' -unalias mysql if [[ $OSTYPE == darwin* ]]; then alias rm=trash; diff --git a/config/config.fish b/config/config.fish new file mode 100644 index 0000000..8411844 --- /dev/null +++ b/config/config.fish @@ -0,0 +1,3 @@ +set fish_greeting '' +eval (python -m virtualfish) + diff --git a/config/fish/functions/adg.fish b/config/fish/functions/adg.fish new file mode 100644 index 0000000..c28784f --- /dev/null +++ b/config/fish/functions/adg.fish @@ -0,0 +1,4 @@ +function adg + vf activate addgene-core + cd ~/code/github/addgene/addgene-core +end diff --git a/config/fish/functions/fish_prompt.fish b/config/fish/functions/fish_prompt.fish new file mode 100644 index 0000000..27701f7 --- /dev/null +++ b/config/fish/functions/fish_prompt.fish @@ -0,0 +1,31 @@ +function fish_prompt --description 'Write out the prompt' + # virtualenv stuff + if set -q VIRTUAL_ENV + echo -n -s (set_color -b blue white) "(" (basename "$VIRTUAL_ENV") ")" (set_color normal) " " + end + set -l last_status $status + + if not set -q __fish_prompt_normal + set -g __fish_prompt_normal (set_color normal) + end + + # PWD + set_color $fish_color_cwd + echo -n (prompt_pwd) + set_color normal + + printf '%s ' (__fish_git_prompt) + + if not test $last_status -eq 0 + set_color $fish_color_error + end + + # Set a pretty date + set_color -b black yellow + echo -n '['(date "+%I:%M %P")']' + set_color normal + + echo -n ' $ ' + + set_color normal +end \ No newline at end of file diff --git a/gitignore b/gitignore index d3ef2b0..0bf7d16 100644 --- a/gitignore +++ b/gitignore @@ -12,3 +12,4 @@ tmp/**/* .pre-commit-config.yaml .ruby-version release_package.sh +local.fish