Skip to content

Commit

Permalink
fix: python venv and remove unused aliases
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Doster <Vladislav.Doster@mastercard.com>
  • Loading branch information
Vladislav Doster authored and Vladislav Doster committed Mar 2, 2023
1 parent 5820595 commit 594fb76
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions zsh/.config/zsh/aliases.zsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# #!/usr/bin/env zsh
#!/usr/bin/env zsh
if builtin echo "$-" | grep i > /dev/null; then export IS_TTY='1'; fi
_error() { [[ -v $IS_TTY ]] && print -P "%F{red}[ERROR]%f %F{white}${1}%f" >&2; }
_info() { [[ -v $IS_TTY ]] && print -P "%F{green}==>%f %F{white}${1}%f"; }
Expand Down Expand Up @@ -62,13 +62,12 @@ alias zireset='builtin cd ${HOME}; unset _comp{_{assocs,dumpfile,options,setup},
# │ NAVIGATION │
# +────────────+
typeset -A pairs=(
.. '..' ... '../..' \
.... '../../..' ..... '../../../..' \
bin '$HOME/.local/bin' \
dl '$HOME/Downloads' hs '$HOME/.hammerspoon' \
rr '$(git rev-parse --show-toplevel)' vd '$XDG_CONFIG_HOME/nvim' \
xch '$XDG_CONFIG_HOME' xdh '$XDG_DATA_HOME' \
zdd '$ZDOTDIR' zfd '$ZDOTDIR/functions' \
.. '..' ... '../..' \
.... '../../..' ..... '../../../..' \
bin '$HOME/.local/bin' rr '$(git rev-parse --show-toplevel)' \
dl '$HOME/Downloads' hs '$HOME/.hammerspoon' \
xch '$XDG_CONFIG_HOME' xdh '$XDG_DATA_HOME' \
zdd '$ZDOTDIR' zfd '$ZDOTDIR/functions' \
)
for k v in ${(kv)pairs[@]}; do
builtin alias -- "$k"="_goto $v" || true
Expand Down Expand Up @@ -102,11 +101,9 @@ alias tmp-md='$EDITOR $(mktemp -t scratch.XXX.md)'
# │ PYTHON │
# +────────+
alias http-serve='python3 -m http.server'
alias pip3='python3 -m pip'
alias py3='python3'
alias pip-requirements='python3 -m pip3 install -r requirements.txt || _error "no requirements.txt found"'
alias venv-activate='source ./.venv/bin/activate'
alias venv-create='python3 -m venv ./.venv'
alias pip-requirements='python3 -m pip install -r requirements.txt || _error "no requirements.txt found"'
alias venv-activate='source ./venv/bin/activate'
alias venv-create='python3 -m venv ./venv'
alias venv-setup='venv-create && venv-activate && pip-requirements'
# +──────────────+
# │ NETWORK INFO │
Expand Down

0 comments on commit 594fb76

Please sign in to comment.