-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathzsh-pipx.plugin.zsh
More file actions
29 lines (19 loc) · 816 Bytes
/
zsh-pipx.plugin.zsh
File metadata and controls
29 lines (19 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# vim:ft=zsh:tw=80:sw=4:sts=4:et
# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# Copyright (c) 2021 Thuan Duong
# According to the Zsh Plugin Standard:
# http://zdharma.org/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
0=${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}
0=${${(M)0:#/*}:-$PWD/$0}
# Then ${0:h} to get plugin's directory
if [[ ${zsh_loaded_plugins[-1]} != */zsh-pipx && -z ${fpath[(r)${0:h}]} ]] {
fpath+=( "${0:h}" )
}
# Standard hash for plugins, to not pollute the namespace
typeset -gA Plugins
Plugins[ZSH_PIPX_DIR]="${0:h}"
# pipx completions
source <(register-python-argcomplete pipx)
# Use alternate vim marks [[[ and ]]] as the original ones can
# confuse nested substitutions, e.g.: ${${${VAR}}}
# vim:ft=zsh:tw=80:sw=4:sts=4:et:foldmarker=[[[,]]]