60 lines
1.1 KiB
Fish
60 lines
1.1 KiB
Fish
#!/usr/bin/fish
|
|
|
|
|
|
# Git aliases
|
|
alias glog "git log --oneline --all --graph"
|
|
|
|
# Misc aliases
|
|
alias icat "kitty +kitten icat --align left"
|
|
alias ls lsd
|
|
|
|
|
|
# Python aliases
|
|
function mkvenv \
|
|
--description "Make a python venv"
|
|
# mkvenv <path>: make venv at path
|
|
# mkvenv <path> <prompt>: 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
|
|
echo -n "Making virtualenv at "
|
|
set_color green
|
|
echo -n $argv[1]
|
|
set_color normal
|
|
echo
|
|
|
|
python -m venv $argv[1]
|
|
|
|
else
|
|
echo "Invalid number of arguments."
|
|
end
|
|
end
|
|
|
|
function venvon \
|
|
--description "Activate a python venv. If no args are provided, assume path is 'venv'"
|
|
if test (count $argv) -eq 0
|
|
source venv/bin/activate.fish
|
|
else if test (count $argv) -eq 1
|
|
source $argv[1]/bin/activate.fish
|
|
else
|
|
echo "Invalid number of arguments."
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
# Enable kitty command completion
|
|
kitty + complete setup fish | source |