Skip to content

Instantly share code, notes, and snippets.

@cuevasclemente
Created April 19, 2021 18:39
Show Gist options
  • Save cuevasclemente/51a9ad48f37302fb6f993d7da655ae30 to your computer and use it in GitHub Desktop.
Save cuevasclemente/51a9ad48f37302fb6f993d7da655ae30 to your computer and use it in GitHub Desktop.
My config.fish base
function l
ls
end
set -x PATH /Users/clemente/.cargo/bin /usr/local/bin $PATH
pyenv init - | source
function show_git_branch
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
end
function fish_prompt --description 'Informative prompt'
#Save the return status of the previous command
set -l last_pipestatus $pipestatus
set ABBR_PWD (echo (dirname (pwd) | sed -e "s;\(/.\{1\}\)[^/]*;\1;g")/(basename (pwd)))
switch "$USER"
case root toor
printf '%s@%s %s%s%s# ' $USER (prompt_hostname) (set -q fish_color_cwd_root
and set_color $fish_color_cwd_root
or set_color $fish_color_cwd) \
(prompt_pwd) (set_color normal)
case '*'
set -l pipestatus_string (__fish_print_pipestatus "[" "] " "|" (set_color $fish_color_status) \
(set_color --bold $fish_color_status) $last_pipestatus)
printf '[%s] %s%s@%s %s%s %s%s%s %s%s \f\r> ' (date "+%H:%M:%S") (set_color brblue) \
$USER (prompt_hostname) (set_color $fish_color_cwd) $ABBR_PWD $pipestatus_string \
(set_color normal) (show_git_branch)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment