Last active
November 13, 2018 05:46
-
-
Save jpillora/dbc57fc1b222a801b7d0 to your computer and use it in GitHub Desktop.
Fish Config
This file contains hidden or 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
set PATH $HOME/bin /usr/local/bin /usr/local/go/bin $PATH | |
set -x GOPATH $HOME/go | |
function fish_greeting | |
end | |
function fish_prompt | |
set_color cyan | |
echo -n $USER | |
echo -n ' ' | |
set_color $fish_color_cwd | |
echo -n (prompt_pwd) | |
set_color normal | |
echo -n ' ' | |
end | |
function prompt_pwd --description 'modify pwd to shorten paths, add git branch' | |
set go "$GOPATH" | |
set gosrc "$go/src" | |
set gogh "$gosrc/github.com" | |
set gojp "$gogh/jpillora" | |
set wd "$PWD" | |
for v in "gojp" "gogh" "ord" "gosrc" "go"; | |
if set wd (string replace "$$v" "" "$PWD"); | |
set_color magenta | |
echo -n "$v" | |
break | |
end | |
end | |
set wd (string replace "$HOME" "~" "$wd") | |
set_color green | |
echo -n "$wd" | |
set_color normal | |
if set branch (git rev-parse --abbrev-ref HEAD 2> /dev/null); | |
echo -n " (" | |
set_color yellow | |
echo -n "$branch" | |
set_color normal | |
echo -n ")" | |
end | |
echo "" | |
end | |
function l | |
exa $argv | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment