Skip to content

Instantly share code, notes, and snippets.

@pateketrueke
Last active December 20, 2015 20:29
Show Gist options
  • Save pateketrueke/6191134 to your computer and use it in GitHub Desktop.
Save pateketrueke/6191134 to your computer and use it in GitHub Desktop.
Fish settings!
set -U EDITOR vim
set -U fish_greeting
set __fish_git_prompt_showdirtystate 'yes'
set __fish_git_prompt_showupstream 'yes'
set __fish_git_prompt_showuntrackedfiles 'yes'
set __fish_git_prompt_color_branch yellow
set __fish_git_prompt_char_cleanstate '✔'
set __fish_git_prompt_char_dirtystate '⚡'
set __fish_git_prompt_char_stagedstate '→'
set __fish_git_prompt_char_invalidstate '✖'
set __fish_git_prompt_char_untrackedfiles '…'
set __fish_git_prompt_char_upstream_equal ''
set __fish_git_prompt_char_upstream_ahead '↑'
set __fish_git_prompt_char_upstream_behind '↓'
function my_prompt_git
__fish_git_prompt | sed -e "s| ||g"
end
function my_prompt_pwd
echo $PWD | sed -e "s|^$HOME|~|" -e "s|.*/||g"
end
function fish_prompt --description 'Write out the prompt'
set -l last_status $status
if not set -q __fish_prompt_normal
set -g __fish_prompt_normal (set_color normal)
end
if not set -q -g __fish_classic_git_functions_defined
set -g __fish_classic_git_functions_defined
function __fish_repaint_status --on-variable fish_color_status
if status --is-interactive
set -e __fish_prompt_status
commandline -f repaint ^/dev/null
end
end
end
switch $USER
case root
if not set -q __fish_prompt_cwd
if set -q fish_color_cwd_root
set -g __fish_prompt_cwd (set_color $fish_color_cwd_root)
else
set -g __fish_prompt_cwd (set_color $fish_color_cwd)
end
end
case '*'
if not set -q __fish_prompt_cwd
set -g __fish_prompt_cwd (set_color $fish_color_cwd)
end
end
set -l prompt_status
if test $last_status -ne 0
if not set -q __fish_prompt_status
set -g __fish_prompt_status (set_color $fish_color_status)
end
set prompt_status "$__fish_prompt_status($last_status)$__fish_prompt_normal"
end
if not set -q __fish_prompt_quote
set -g __fish_prompt_quote (set_color $fish_color_quote)
end
echo -n -s "$prompt_status"
echo -n -s "[$__fish_prompt_cwd" (my_prompt_pwd) "$__fish_prompt_normal]"
echo -n -s (my_prompt_git) "\$ "
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment