Skip to content

Instantly share code, notes, and snippets.

@rrdelaney
Last active May 3, 2016 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rrdelaney/8077bb300568bbabd9e1433ffaf5c365 to your computer and use it in GitHub Desktop.
Save rrdelaney/8077bb300568bbabd9e1433ffaf5c365 to your computer and use it in GitHub Desktop.
Fish Functions
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
# 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
# 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