1
0
Fork 0
dotfiles/fish/config.fish

60 lines
1.1 KiB
Fish
Raw Normal View History

2021-04-24 17:30:03 -07:00
#!/usr/bin/fish
2022-07-09 08:47:29 -07:00
# Git aliases
2021-04-24 17:30:03 -07:00
alias glog "git log --oneline --all --graph"
2022-07-09 08:47:29 -07:00
# Misc aliases
2021-04-24 17:30:03 -07:00
alias icat "kitty +kitten icat --align left"
2022-07-09 08:47:29 -07:00
alias ls lsd
2021-04-24 17:30:03 -07:00
2022-07-09 08:47:29 -07:00
# 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
2022-07-09 08:52:29 -07:00
echo -n "Making virtualenv at "
set_color green
echo -n $argv[1]
set_color normal
echo -n " with prompt "
2022-07-09 08:47:29 -07:00
set_color "green"
echo -n $argv[2]
set_color normal
echo
python -m venv --prompt=$argv[2] $argv[1]
2022-07-09 08:52:29 -07:00
2022-07-09 08:47:29 -07:00
else if test (count $argv) -eq 1
echo -n "Making virtualenv at "
set_color green
echo -n $argv[1]
set_color normal
echo
2021-04-24 17:30:03 -07:00
2022-07-09 08:47:29 -07:00
python -m venv $argv[1]
2022-07-09 08:52:29 -07:00
2022-07-09 08:47:29 -07:00
else
echo "Invalid number of arguments."
end
end
2021-04-24 17:30:03 -07:00
2022-07-09 08:47:29 -07:00
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