Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
cc5100d1
Unverified
Commit
cc5100d1
authored
Dec 09, 2022
by
Neil Girdhar
Committed by
GitHub
Dec 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(pip): add several aliases (#10647)
parent
f4dc8c5b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
README.md
plugins/pip/README.md
+8
-0
pip.plugin.zsh
plugins/pip/pip.plugin.zsh
+25
-1
No files found.
plugins/pip/README.md
View file @
cc5100d1
...
...
@@ -22,6 +22,14 @@ the next time you autocomplete `pip install`.
| Alias | Description |
| :------- | :-------------------------------------------- |
| pipi | Install packages |
| pipig | Install package from GitHub repository |
| pipigb | Install package from GitHub branch |
| pipigp | Install package from GitHub pull request |
| pipu | Upgrade packages |
| pipun | Uninstall packages |
| pipgi | Grep through installed packages |
| piplo | List outdated packages |
| pipreq | Create requirements file |
| pipir | Install packages from
`requirements.txt`
file |
| pipupall | Update all installed packages |
...
...
plugins/pip/pip.plugin.zsh
View file @
cc5100d1
...
...
@@ -88,6 +88,12 @@ else
alias
pip
=
"noglob pip"
fi
alias
pipi
=
"pip install"
alias
pipu
=
"pip install --upgrade"
alias
pipun
=
"pip uninstall"
alias
pipgi
=
"pip freeze | grep"
alias
piplo
=
"pip list -o"
# Create requirements file
alias
pipreq
=
"pip freeze > requirements.txt"
...
...
@@ -102,10 +108,28 @@ function pipupall {
pip list
--outdated
|
awk
'NR > 2 { print $1 }'
|
${
=xargs
}
pip
install
--upgrade
}
# Uninstall
ed
all installed packages
# Uninstall all installed packages
function
pipunall
{
# non-GNU xargs does not support nor need `--no-run-if-empty`
local
xargs
=
"xargs --no-run-if-empty"
xargs
--version
2>/dev/null |
grep
-q
GNU
||
xargs
=
"xargs"
pip list
--format
freeze |
cut
-d
=
-f1
|
${
=xargs
}
pip uninstall
}
# Install from GitHub repository
function
pipig
{
pip
install
"git+https://github.com/
$1
.git"
}
compdef _pip pipig
# Install from GitHub branch
function
pipigb
{
pip
install
"git+https://github.com/
$1
.git@
$2
"
}
compdef _pip pipigb
# Install from GitHub pull request
function
pipigp
{
pip
install
"git+https://github.com/
$1
.git@refs/pull/
$2
/head"
}
compdef _pip pipigp
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment