2014-10-29 09:24:08 -07:00
|
|
|
# Directories {{{
|
|
|
|
|
|
|
|
function l
|
|
|
|
tree --dirsfirst -ChFL 1 $args
|
|
|
|
end
|
|
|
|
function ll
|
|
|
|
tree --dirsfirst -ChFupDaL 1 $args
|
|
|
|
end
|
|
|
|
|
|
|
|
# }}}
|
|
|
|
# Directories {{{
|
|
|
|
|
|
|
|
set -g -x fish_greeting ''
|
|
|
|
set -g -x EDITOR vim
|
|
|
|
|
|
|
|
# }}}
|
|
|
|
# Git and Mercurial functions {{{
|
|
|
|
|
|
|
|
function gca
|
|
|
|
git commit -a $argv
|
|
|
|
end
|
|
|
|
function gco
|
|
|
|
git checkout $argv
|
|
|
|
end
|
|
|
|
function gd
|
|
|
|
git diff HEAD
|
|
|
|
end
|
|
|
|
function gl
|
|
|
|
git pull $argv
|
|
|
|
end
|
|
|
|
function gp
|
|
|
|
git push $argv
|
|
|
|
end
|
|
|
|
function gst
|
|
|
|
git status $argv
|
|
|
|
end
|
|
|
|
|
|
|
|
# }}}
|
|
|
|
# Programs {{{
|
|
|
|
|
|
|
|
function logs
|
|
|
|
sudo supervisorctl tail -f snipt stdout
|
|
|
|
end
|
2014-10-30 09:22:26 -07:00
|
|
|
function pm
|
|
|
|
python manage.py $argv
|
|
|
|
end
|
2014-10-29 09:24:08 -07:00
|
|
|
function run
|
|
|
|
sudo supervisorctl restart snipt
|
|
|
|
sudo supervisorctl tail -f snipt stdout
|
|
|
|
end
|
|
|
|
function rs
|
|
|
|
sudo supervisorctl restart snipt
|
|
|
|
end
|
|
|
|
function ssc
|
|
|
|
sudo supervisorctl $argv
|
|
|
|
end
|
|
|
|
function wo
|
|
|
|
workon (cat .venv) $argv
|
|
|
|
end
|
|
|
|
|
|
|
|
# }}}
|
|
|
|
# Prompt {{{
|
|
|
|
|
|
|
|
set -x fish_color_command 005fd7\x1epurple
|
|
|
|
set -x fish_color_search_match --background=purple
|
|
|
|
|
|
|
|
function prompt_pwd --description 'Print the current working directory, shortend to fit the prompt'
|
|
|
|
echo $PWD | sed -e "s|^$HOME|~|"
|
|
|
|
end
|
|
|
|
|
|
|
|
function virtualenv_prompt
|
|
|
|
if [ -n "$VIRTUAL_ENV" ]
|
|
|
|
printf '\033[0;37m(%s) ' (basename "$VIRTUAL_ENV") $argv
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function fish_prompt
|
|
|
|
z --add "$PWD"
|
|
|
|
echo ' '
|
|
|
|
printf '\033[0;31m%s\033[0;37m on ' (whoami)
|
|
|
|
printf '\033[0;31m%s ' (hostname -f)
|
|
|
|
printf '\033[0;32m%s' (prompt_pwd)
|
|
|
|
echo
|
|
|
|
virtualenv_prompt
|
|
|
|
printf '\033[0;37m> '
|
|
|
|
end
|
|
|
|
|
|
|
|
# }}}
|
|
|
|
# Virtualenv {{{
|
|
|
|
|
|
|
|
set -x WORKON_HOME '/var/www/.virtualenvs'
|
2014-11-20 16:47:42 -08:00
|
|
|
. ~/.config/fish/virtualenv.fish
|
2014-10-29 09:24:08 -07:00
|
|
|
|
|
|
|
# }}}
|
|
|
|
# Z {{{
|
|
|
|
|
2014-11-20 16:47:42 -08:00
|
|
|
. /etc/z.fish
|
2014-10-29 09:24:08 -07:00
|
|
|
|
|
|
|
function j
|
|
|
|
z $argv
|
|
|
|
end
|
|
|
|
|
|
|
|
# }}}
|