#!/usr/bin/fish # Variables set --export GOPATH "/home/mark/Documents/go" # Empty greeging set fish_greeting # Misc aliases alias glog "git log --oneline --all --graph" alias icat "kitty +kitten icat --align left" alias ls lsd alias !! $history[1] # Python aliases function mkvenv \ --description "Make a python venv" # mkvenv: make venv at ./venv # mkvenv : make venv at path # mkvenv : make venv at path and set prompt. if test (count $argv) -eq 2 echo -n "Making virtualenv at " set_color green echo -n $argv[1] set_color normal echo -n " with prompt " set_color "green" echo -n $argv[2] set_color normal echo python -m venv --prompt=$argv[2] $argv[1] else if test (count $argv) -eq 1 if test -e "./venv" set_color red echo -n "Cannot make venv at " set_color normal echo -n "$argv[1]" set_color red echo ": path exists." set_color normal else echo -n "Making virtualenv at " set_color green echo -n "$argv[1]" set_color normal echo python -m venv $argv[1] end else if test (count $argv) -eq 0 mkvenv "./venv" else set_color red echo "Invalid number of arguments." set_color normal end end function venvon \ --description "Activate a python venv. If no args are provided, assume path is 'venv'" if test (count $argv) -eq 0 venvon "./venv" else if test (count $argv) -eq 1 if test -e "$argv[1]/bin/activate.fish" source "$argv[1]/bin/activate.fish" else set_color red echo -n "Cannot find activation script, is " set_color normal echo -n "$argv[1]" set_color red echo " a venv?" set_color normal end else set_color red echo "Invalid number of arguments." set_color normal end end