67 lines
1.3 KiB
Fish
67 lines
1.3 KiB
Fish
#!/usr/bin/fish
|
|
|
|
|
|
set fish_greeting
|
|
set --export GOPATH "/home/mark/Documents/go"
|
|
|
|
set --export TEXINPUTS "/home/mark/Documents/latex"
|
|
|
|
# Git aliases
|
|
alias glog "git log --oneline --all --graph"
|
|
|
|
# Misc aliases
|
|
alias icat "kitty +kitten icat --align left"
|
|
alias ls lsd
|
|
|
|
alias !! $history[1]
|
|
|
|
# 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
|