abra zsh config 2.0
This commit is contained in:
@@ -7,17 +7,22 @@ frontends.
|
||||
Settings
|
||||
--------
|
||||
|
||||
To enable a Pacman frontend, for example, [Yaourt][2], add the following line to
|
||||
*zpreztorc*:
|
||||
It is possible to use a Pacman frontend with the pacman aliases provided by this
|
||||
package as long as that frontend supports the same command line options (The
|
||||
[AUR Helpers][2] page has a good comparison which lists if the command line
|
||||
options are pacman compatible).
|
||||
|
||||
zstyle ':prezto:module:pacman' frontend 'yaourt'
|
||||
Please note that installing packages with an AUR Helper is not officially
|
||||
supported by Archlinux. It is currently recommended to manually build AUR
|
||||
packages using the [provided instructions][3]. The [aurutils][4] project has a
|
||||
set of small utilities to make this easier.
|
||||
|
||||
If you have enabled color globally in *zpreztorc*, you may disable it for certain
|
||||
commands.
|
||||
To enable a Pacman frontend, add the following line to *zpreztorc*, substituting
|
||||
`pacman_frontend` with the name of the frontent:
|
||||
|
||||
To disable `yaourt` highlighting, add the following line to *zpreztorc*:
|
||||
|
||||
zstyle ':prezto:module:pacman:yaourt' color 'no'
|
||||
```sh
|
||||
zstyle ':prezto:module:pacman' frontend 'pacman_frontend'
|
||||
```
|
||||
|
||||
Aliases
|
||||
-------
|
||||
@@ -42,24 +47,23 @@ Aliases
|
||||
|
||||
### Frontends
|
||||
|
||||
#### Yaourt
|
||||
|
||||
- `pacc` manages *.pac\** files.
|
||||
|
||||
Functions
|
||||
---------
|
||||
|
||||
- `aurget` clone an aur package
|
||||
- `pacman-list-explicit` lists explicitly installed pacman packages.
|
||||
- `pacman-list-disowned` lists pacman disowned files.
|
||||
|
||||
Authors
|
||||
-------
|
||||
|
||||
*The authors of this module should be contacted via the [issue tracker][3].*
|
||||
*The authors of this module should be contacted via the [issue tracker][5].*
|
||||
|
||||
- [Benjamin Boudreau](https://github.com/dreur)
|
||||
- [Sorin Ionescu](https://github.com/sorin-ionescu)
|
||||
|
||||
[1]: http://www.archlinux.org/pacman/
|
||||
[2]: http://archlinux.fr/yaourt-en
|
||||
[3]: https://github.com/sorin-ionescu/prezto/issues
|
||||
[2]: https://wiki.archlinux.org/index.php/AUR_helpers#Comparison_table
|
||||
[3]: https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages
|
||||
[4]: https://github.com/AladW/aurutils
|
||||
[5]: https://github.com/sorin-ionescu/prezto/issues
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
# function pacman-list-disowned {
|
||||
|
||||
local tmp="${TMPDIR:-/tmp}/pacman-disowned-$UID-$$"
|
||||
local db="$tmp/db"
|
||||
local fs="$tmp/fs"
|
||||
@@ -20,3 +22,5 @@ find /bin /etc /lib /sbin /usr \
|
||||
\( -type d -printf '%p/\n' -o -print \) | sort > "$fs"
|
||||
|
||||
comm -23 "$fs" "$db"
|
||||
|
||||
# }
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
# function pacman-list-explicit {
|
||||
|
||||
pacman --query --explicit --info \
|
||||
| awk '
|
||||
BEGIN {
|
||||
@@ -18,3 +20,5 @@ pacman --query --explicit --info \
|
||||
print $2
|
||||
}
|
||||
'
|
||||
|
||||
# }
|
||||
|
@@ -23,10 +23,6 @@ zstyle -s ':prezto:module:pacman' frontend '_pacman_frontend'
|
||||
|
||||
if (( $+commands[$_pacman_frontend] )); then
|
||||
alias pacman="$_pacman_frontend"
|
||||
|
||||
if [[ -s "${0:h}/${_pacman_frontend}.zsh" ]]; then
|
||||
source "${0:h}/${_pacman_frontend}.zsh"
|
||||
fi
|
||||
else
|
||||
_pacman_frontend='pacman'
|
||||
_pacman_sudo='sudo '
|
||||
@@ -70,9 +66,9 @@ alias pacman-list-orphans="${_pacman_sudo}${_pacman_frontend} --query --deps --u
|
||||
alias pacman-remove-orphans="${_pacman_sudo}${_pacman_frontend} --remove --recursive \$(${_pacman_frontend} --quiet --query --deps --unrequired)"
|
||||
|
||||
# Synchronizes the local package and Arch Build System databases against the
|
||||
# repositories.
|
||||
if (( $+commands[abs] )); then
|
||||
alias pacu="${_pacman_sudo}${_pacman_frontend} --sync --refresh && sudo abs"
|
||||
# repositories using the asp tool.
|
||||
if (( $+commands[asp] )); then
|
||||
alias pacu="${_pacman_sudo}${_pacman_frontend} --sync --refresh && sudo asp update"
|
||||
else
|
||||
alias pacu="${_pacman_sudo}${_pacman_frontend} --sync --refresh"
|
||||
fi
|
||||
@@ -81,4 +77,12 @@ fi
|
||||
# upgrades outdated packages.
|
||||
alias pacU="${_pacman_sudo}${_pacman_frontend} --sync --refresh --sysupgrade"
|
||||
|
||||
function aurget {
|
||||
local target_dir="$1"
|
||||
if [[ -n "$2" ]]; then
|
||||
target_dir="$2"
|
||||
fi
|
||||
git clone "https://aur.archlinux.org/$1" "$target_dir"
|
||||
}
|
||||
|
||||
unset _pacman_{frontend,sudo}
|
||||
|
@@ -1,18 +0,0 @@
|
||||
#
|
||||
# Defines Yaourt aliases.
|
||||
#
|
||||
# Authors:
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
#
|
||||
# Aliases
|
||||
#
|
||||
|
||||
# Disable color.
|
||||
if ! zstyle -t ':prezto:module:pacman:yaourt' color; then
|
||||
alias pacman='yaourt --nocolor'
|
||||
fi
|
||||
|
||||
# Manages .pac* files.
|
||||
alias pacc='yaourt -C'
|
Reference in New Issue
Block a user