Last active
May 3, 2016 16:54
-
-
Save rrdelaney/8077bb300568bbabd9e1433ffaf5c365 to your computer and use it in GitHub Desktop.
Fish Functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bs -d "Bootstraps a project environment" | |
if test -d ~/Documents/dev/$argv[1] | |
cd ~/Documents/dev/$argv[1] | |
else if test -d ~/Documents/dev/go/$argv[1] | |
cd ~/Documents/dev/go/$argv[1] | |
else if test -d ~/Documents/union/$argv[1] | |
cd ~/Documents/union/$argv[1]/$argv[1] | |
else if test -d ~/Documents/$argv[1] | |
cd ~/Documents/$argv[1] | |
else | |
echo "Unable to find project!" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# eval thefuck --alias | |
gulp --completion=fish | source | |
set -x GOPATH ~/Documents/dev/go | |
set -gx PATH ~/scripts $GOPATH/bin $PATH | |
set -x EDITOR vim | |
set -x etc :2379/v2/keys | |
alias serve "python3 -m http.server 8000" | |
set fisher_home ~/.local/share/fisherman | |
set fisher_config ~/.config/fisherman | |
source $fisher_home/config.fish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# name: L | |
function _git_branch_name | |
echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') | |
end | |
function _is_git_dirty | |
echo (command 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment