Fixed vim and zsh
This commit is contained in:
61
zsh/modules/pacman/README.md
Normal file
61
zsh/modules/pacman/README.md
Normal file
@ -0,0 +1,61 @@
|
||||
Pacman
|
||||
======
|
||||
|
||||
Adds aliases for the pacman package manager.
|
||||
|
||||
Also includes optional helper(s).
|
||||
|
||||
.zimrc Configuration
|
||||
-------------
|
||||
* `zpacman_frontend='helper_here'` Set helper_here to a wrapper if applicable (powerpill, pacmatic, etc).
|
||||
* `zpacman_helper=(aur)` add/remove any helper scripts to be loaded here.
|
||||
|
||||
Helpers
|
||||
-------
|
||||
|
||||
### aur
|
||||
|
||||
provides simple AUR helper aliases.
|
||||
|
||||
* `aurb package_name` clone the package from the AUR, build, and install.
|
||||
* `aurd package_name` clone the package from the AUR, but do not build.
|
||||
* `auru` run inside a directory created with `aurb`, this will update, build, and install a package.
|
||||
|
||||
Aliases
|
||||
-------
|
||||
|
||||
### Build
|
||||
|
||||
* `pacb` build package in the current directory, cleanup, and install.
|
||||
|
||||
### Install
|
||||
|
||||
* `paci` install, sync, and upgrade packages.
|
||||
* `pacu` install, sync, and upgrade packages (forcibly refresh package list).
|
||||
* `pacU` install packages from pkg file.
|
||||
* `pacd` install all packages in current directory.
|
||||
|
||||
### Remove
|
||||
|
||||
* `pacr` remove package and unneeded dependencies.
|
||||
* `pacrm` remove package, unneded dependencies, and configuration files.
|
||||
|
||||
### Query
|
||||
|
||||
* `pacq` query package information from remote repository
|
||||
* `pacQ` query package information from local repository
|
||||
|
||||
### Search
|
||||
|
||||
* `pacs` search for package in the remote repository
|
||||
* `pacS` search for package in the local repository
|
||||
|
||||
### Orphans
|
||||
|
||||
* `pacol` list orphan packages
|
||||
* `pacor` remove all orphan packages
|
||||
|
||||
### Ownership
|
||||
|
||||
* `pacown` list all files provided by a given package
|
||||
* `pacblame` show package(s) that own a specified file
|
20
zsh/modules/pacman/helper_aur.zsh
Normal file
20
zsh/modules/pacman/helper_aur.zsh
Normal file
@ -0,0 +1,20 @@
|
||||
#
|
||||
# AUR aliases
|
||||
#
|
||||
|
||||
# download and build AUR package
|
||||
aurb() {
|
||||
git clone https://aur.archlinux.org/${1}.git && cd ${1} && makepkg --clean --install --syncdeps
|
||||
}
|
||||
|
||||
# only download aur package; do not build
|
||||
aurd() {
|
||||
git clone https://aur.archlinux.org/${1}.git
|
||||
}
|
||||
|
||||
# remove old package, rebuild, and install.
|
||||
#NOTE: this is will remove any unstashed/uncommitted changes.
|
||||
# due to how makepkg will update the PKGBUILD, a git pull alone will not suffice.
|
||||
auru() {
|
||||
git reset HEAD --hard && git pull && makepkg --clean --force --install --syncdeps --cleanbuild
|
||||
}
|
135
zsh/modules/pacman/init.zsh
Normal file
135
zsh/modules/pacman/init.zsh
Normal file
@ -0,0 +1,135 @@
|
||||
#
|
||||
# Pacman aliases
|
||||
#
|
||||
|
||||
# ${zpacman_frontend} is provided by either .zimrc or (if not set) init.zsh
|
||||
# The zpacman_frontend is _only_ used for package installs.
|
||||
|
||||
#
|
||||
# Setup
|
||||
#
|
||||
|
||||
# ensure pacman is available
|
||||
if (( ! ${+commands[pacman]} )); then
|
||||
return 1
|
||||
fi
|
||||
|
||||
local zpacman_frontend_priv helper
|
||||
|
||||
if (( ! ${+zpacman_frontend} )); then
|
||||
zpacman_frontend='pacman'
|
||||
zpacman_frontend_priv='sudo pacman'
|
||||
elif (( ! ${+commands[${zpacman_frontend}]} )); then
|
||||
print "pacman frontend \"${zpacman_frontend}\" is invalid or not installed. Reverting to \"pacman\".
|
||||
You can fix this error by editing the 'zpacman_frontend' variable in your .zimrc" >&2
|
||||
zpacman_frontend='pacman'
|
||||
zpacman_frontend_priv='sudo pacman'
|
||||
elif [[ ${zpacman_frontend} == ("yaourt"|"pacaur") ]]; then
|
||||
# yaourt and pacaur handles SUID themselves
|
||||
zpacman_frontend_priv="${zpacman_frontend}"
|
||||
else
|
||||
zpacman_frontend_priv="sudo ${zpacman_frontend}"
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# General
|
||||
#
|
||||
|
||||
alias pac=${zpacman_frontend}
|
||||
|
||||
#
|
||||
# Build
|
||||
#
|
||||
|
||||
# build package in current directory, cleanup, and install
|
||||
alias pacb='makepkg -sci'
|
||||
|
||||
#
|
||||
# Install
|
||||
#
|
||||
|
||||
#NOTE: Installing/upgrading individual packages is NOT supported. Sync and upgrade ALL on install.
|
||||
|
||||
# install, sync, and upgrade packages
|
||||
alias paci="${zpacman_frontend_priv} -Syu"
|
||||
|
||||
# install packages without syncing
|
||||
alias pacI="${zpacman_frontend_priv} -S"
|
||||
|
||||
# install, sync, and upgrade packages (forcibly refresh package lists)
|
||||
alias pacu="${zpacman_frontend_priv} -Syyu"
|
||||
|
||||
# install packages by filename
|
||||
alias pacU="${zpacman_frontend_priv} -U"
|
||||
|
||||
# install all packages in current directory
|
||||
alias pacd="${zpacman_frontend_priv} -U *.pkg.tar.xz"
|
||||
|
||||
|
||||
#
|
||||
# Remove
|
||||
#
|
||||
|
||||
# remove package and unneeded dependencies
|
||||
alias pacr="${zpacman_frontend_priv} -R"
|
||||
|
||||
# remove package, unneeded dependencies, and configuration files
|
||||
alias pacrm="${zpacman_frontend_priv} -Rns"
|
||||
|
||||
|
||||
#
|
||||
# Query
|
||||
#
|
||||
|
||||
# query package information from the remote repository
|
||||
alias pacq="${zpacman_frontend} -Si"
|
||||
|
||||
# query package information from the local repository
|
||||
alias pacQ="${zpacman_frontend} -Qi"
|
||||
|
||||
|
||||
#
|
||||
# Search
|
||||
#
|
||||
|
||||
# search for package in the remote repository
|
||||
alias pacs="${zpacman_frontend} -Ss"
|
||||
|
||||
# search for the package in the local repository
|
||||
alias pacS="${zpacman_frontend} -Qs"
|
||||
|
||||
|
||||
#
|
||||
# Orphans
|
||||
#
|
||||
|
||||
# list orphan packages
|
||||
alias pacol="${zpacman_frontend} -Qdt"
|
||||
|
||||
# remove orphan packages
|
||||
alias pacor="${zpacman_frontend_priv} -Rns \$(pacman -Qtdq)"
|
||||
|
||||
|
||||
#
|
||||
# Ownership
|
||||
#
|
||||
|
||||
# list all files that belong to a package
|
||||
alias pacown="${zpacman_frontend} -Ql"
|
||||
|
||||
# show package(s) owning the specified file
|
||||
alias pacblame="${zpacman_frontend} -Qo"
|
||||
|
||||
#
|
||||
# Helpers
|
||||
#
|
||||
|
||||
# source helper functions/aliases
|
||||
for helper ( ${zpacman_helper[@]} ); do
|
||||
if [[ -s ${0:h}/helper_${helper}.zsh ]]; then
|
||||
source ${0:h}/helper_${helper}.zsh
|
||||
else
|
||||
print "no such helper script \"helper_${helper}.zsh\"" >&2
|
||||
fi
|
||||
done
|
BIN
zsh/modules/pacman/init.zsh.zwc
Normal file
BIN
zsh/modules/pacman/init.zsh.zwc
Normal file
Binary file not shown.
Reference in New Issue
Block a user