Add aliases for different python versions

This commit is contained in:
ItsDrike 2021-12-18 03:02:02 +01:00
parent 56556173e2
commit a0dfc5fd09
No known key found for this signature in database
GPG key ID: FB8CA11A2CF3A843

View file

@ -78,11 +78,19 @@ alias zi='z -I' # cd with interactive fzf selection
alias zbi='z -b -I' # pick parent directory to cd into with fzf alias zbi='z -b -I' # pick parent directory to cd into with fzf
# Python # Python
alias py3='python3'
alias py2='python2'
alias ipy='ipython' alias ipy='ipython'
alias bpy='bpython' alias bpy='bpython'
command -v ipython > /dev/null && alias py='ipython' || alias py='python' command -v ipython > /dev/null && alias py='ipython' || alias py='python'
for version in "2 3 3.6 3.7 3.8 3.9 3.10"; do # Make aliases for py3.6,py3.7,...
if ! command -v "python$version" > /dev/null; then
continue
fi
if command -v "ipython$version" > /dev/null; then
alias "py$version"="ipython$version"
else
alias "py$version"="python$version"
fi
done
# Fallbacks # Fallbacks
command -v hd > /dev/null || alias hd='hexdump -C' # Cannonical hex dump; some systems have this symlinked command -v hd > /dev/null || alias hd='hexdump -C' # Cannonical hex dump; some systems have this symlinked