1
0
.dotfiles/home/.config/fish/config.fish

89 lines
1.8 KiB
Fish
Raw Normal View History

2014-03-03 22:22:04 +00:00
# config.fish
# Kirsle's config.fish
# Updated: 2014-03-03
2014-03-03 22:34:14 +00:00
function fish_greeting
echo -s (set_color FF9900) "-== " (fish --version ^&1) " ==-" (set_color normal)
echo -s (set_color FFFF00) " Date: " (set_color FFFFFF) (date) (set_color normal)
echo -s (set_color FFFF00) "Uptime: " (set_color FFFFFF) (uptime) (set_color normal)
end
2014-03-03 22:22:04 +00:00
# Normalize the $PATH.
2014-09-30 03:20:11 +00:00
set -gx PATH /usr/sbin /sbin /usr/bin /bin /usr/local/sbin /usr/local/bin $HOME/bin $HOME/go/bin $HOME/android/sdk/platform-tools
2014-03-03 22:22:04 +00:00
2014-04-11 22:22:21 +00:00
set -gx EDITOR /usr/bin/vim
2014-03-04 01:55:05 +00:00
# 256 colors
if test $TERM = "xterm"
set -x TERM "xterm-256color"
end
2014-03-03 22:22:04 +00:00
# VirtualEnv
set -g VIRTUALFISH_HOME $HOME/.virtualenv
set -g VIRTUALFISH_COMPAT_ALIASES
. ~/.config/fish/virtual.fish
2015-06-03 20:37:25 +00:00
# Git repo branches
function git_branch
git branch 2>/dev/null | grep -v '^[^*]' | perl -pe 's/^\*\s+//g'
end
2014-03-03 22:22:04 +00:00
# Shell prompt
2015-06-03 20:37:25 +00:00
function base_prompt
2014-03-03 22:22:04 +00:00
# VirtualEnv prefix
if set -q VIRTUAL_ENV
2014-03-03 22:50:35 +00:00
echo -n -s (set_color FF9900) "(" (basename "$VIRTUAL_ENV") ")" (set_color normal)
2014-03-03 22:22:04 +00:00
end
set_color --bold 0099FF
echo -n "["
set_color FF99FF
echo -n (whoami)
set_color 0099FF
echo -n "@"
set_color FF99FF
echo -n (hostname)
echo -n " "
set_color 00FF00
echo -n (prompt_pwd)
2015-06-03 20:37:25 +00:00
# git branch
set branch (git_branch)
if test -n "$branch"
set_color 00FFFF
echo -n " ($branch)"
end
2014-03-03 22:22:04 +00:00
set_color 0099FF
echo -n "]\$ "
set_color normal
end
2015-06-03 20:37:25 +00:00
function fish_prompt
echo -n (base_prompt)
end
2014-03-03 22:22:04 +00:00
# Title bar
function fish_title
if set -q FISH_CUSTOM_TITLE
echo -n $FISH_CUSTOM_TITLE
else
echo -n -s (whoami) "@" (hostname) ":" (prompt_pwd)
end
end
2015-06-26 23:59:28 +00:00
# `sudo !!` compat for fish shell
function sudo
if test "$argv" = !!
eval command sudo $history[1]
else
command sudo $argv
end
end
2015-06-03 20:37:25 +00:00
# Source local system-specific config.
if test -e ~/.local.fish
. ~/.local.fish
end