dotfiles/shell_funcs.fish

73 lines
1.4 KiB
Fish
Raw Normal View History

2022-10-05 03:42:00 +00:00
#!/usr/bin/fish
# Functions
function httpdiff
diff --color -r -c <(curl -s "$1" 2>&1) <(curl -s "$2" 2>&1)
end
2022-10-05 04:48:38 +00:00
function cg
set _dir_ (git rev-parse --show-toplevel)
cd $_dir_
end
2022-10-05 18:39:53 +00:00
function ve
2022-10-05 14:10:20 +00:00
set base (git rev-parse --show-toplevel)
source $base/venv/bin/activate.fish
end
2022-10-05 03:42:00 +00:00
function cpbr
set branch (git symbolic-ref --short -q HEAD)
if test branch
then
printf "$branch" | pbcopy
osascript -e "display notification \"$branch copied to clipboard\" with title \"cpbr\""
else
echo "no branch, can't copy"
end
end
function settitle
echo -ne "\033]0;"$argv"\007"
end
function pullall
2022-10-05 14:10:20 +00:00
for d in ./*/
cd "$d" && pwd && git pull
cd ..
end
2022-10-05 03:42:00 +00:00
end
function gh_mainall
2022-10-05 14:10:20 +00:00
for d in ./*/
cd "$d" && pwd && git checkout main; git pull
cd ..
end
2022-10-05 03:42:00 +00:00
end
function allbranches
2022-10-05 14:10:20 +00:00
for d in ./*/
2022-10-31 19:26:29 +00:00
cd "$d"
set branch (git symbolic-ref --short -q HEAD)
set repo (basename (pwd))
echo $branch $repo
2022-10-05 14:10:20 +00:00
cd ..
end
2022-10-05 03:42:00 +00:00
end
function new_dock_space
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock
end
# Jupyter lab!
function lab
source ~/JUPYTER/bin/activate
cd ~/scratch
powerpip
pip install -r jupyter_requirements.txt
jupyter lab
deactivate
end
source ~/code/dotfiles/jobs/everquote.fish