1
0
Fork 0

Merge pull request #4 from sorin-ionescu/master

Sync with upstream
pull/1537/head
H-Lo 7 years ago committed by GitHub
commit 2567ecdec9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,7 +16,6 @@ setopt PUSHD_IGNORE_DUPS # Do not store duplicates in the stack.
setopt PUSHD_SILENT # Do not print the directory stack after pushd or popd. setopt PUSHD_SILENT # Do not print the directory stack after pushd or popd.
setopt PUSHD_TO_HOME # Push to home directory when no argument is given. setopt PUSHD_TO_HOME # Push to home directory when no argument is given.
setopt CDABLE_VARS # Change directory to a path stored in a variable. setopt CDABLE_VARS # Change directory to a path stored in a variable.
setopt AUTO_NAME_DIRS # Auto add variable-stored paths to ~ list.
setopt MULTIOS # Write to multiple descriptors. setopt MULTIOS # Write to multiple descriptors.
setopt EXTENDED_GLOB # Use extended globbing syntax. setopt EXTENDED_GLOB # Use extended globbing syntax.
unsetopt CLOBBER # Do not overwrite existing files with > and >>. unsetopt CLOBBER # Do not overwrite existing files with > and >>.

@ -14,8 +14,7 @@ fi
# Options # Options
# #
# Beep on error in line editor. setopt BEEP # Beep on error in line editor.
setopt BEEP
# #
# Variables # Variables
@ -242,6 +241,27 @@ function glob-alias {
} }
zle -N glob-alias zle -N glob-alias
# Toggle the comment character at the start of the line. This is meant to work
# around a buggy implementation of pound-insert in zsh.
#
# This is currently only used for the emacs keys because vi-pound-insert has
# been reported to work properly.
function pound-toggle {
if [[ "$BUFFER" = '#'* ]]; then
# Because of an oddity in how zsh handles the cursor when the buffer size
# changes, we need to make this check before we modify the buffer and let
# zsh handle moving the cursor back if it's past the end of the line.
if [[ $CURSOR != $#BUFFER ]]; then
(( CURSOR -= 1 ))
fi
BUFFER="${BUFFER:1}"
else
BUFFER="#$BUFFER"
(( CURSOR += 1 ))
fi
}
zle -N pound-toggle
# Reset to default key bindings. # Reset to default key bindings.
bindkey -d bindkey -d
@ -277,6 +297,12 @@ if (( $+widgets[history-incremental-pattern-search-backward] )); then
history-incremental-pattern-search-forward history-incremental-pattern-search-forward
fi fi
# Toggle comment at the start of the line. Note that we use pound-toggle which
# is similar to pount insert, but meant to work around some issues that were
# being seen in iTerm.
bindkey -M emacs "$key_info[Escape];" pound-toggle
# #
# Vi Key Bindings # Vi Key Bindings
# #
@ -296,6 +322,9 @@ else
bindkey -M vicmd "/" history-incremental-search-forward bindkey -M vicmd "/" history-incremental-search-forward
fi fi
# Toggle comment at the start of the line.
bindkey -M vicmd "#" vi-pound-insert
# #
# Emacs and Vi Key Bindings # Emacs and Vi Key Bindings
# #

@ -34,6 +34,7 @@ fi
setopt COMBINING_CHARS # Combine zero-length punctuation characters (accents) setopt COMBINING_CHARS # Combine zero-length punctuation characters (accents)
# with the base character. # with the base character.
setopt INTERACTIVE_COMMENTS # Enable comments in interactive shell.
setopt RC_QUOTES # Allow 'Henry''s Garage' instead of 'Henry'\''s Garage'. setopt RC_QUOTES # Allow 'Henry''s Garage' instead of 'Henry'\''s Garage'.
unsetopt MAIL_WARNING # Don't print a warning message if a mail file has been accessed. unsetopt MAIL_WARNING # Don't print a warning message if a mail file has been accessed.

@ -8,23 +8,20 @@ Settings
-------- --------
It is possible to use a Pacman frontend with the pacman aliases provided by this 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 (Such as package as long as that frontend supports the same command line options (The
[Pacaur][2] or [Yaourt][3]). [AUR Helpers][2] page has a good comparison which lists if the command line
options are pacman compatible).
To enable a Pacman frontend, for example, [Pacaur][2], add the following line to Please note that installing packages with an AUR Helper is not officially
*zpreztorc*: 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.
```sh To enable a Pacman frontend, add the following line to *zpreztorc*, substituting
zstyle ':prezto:module:pacman' frontend 'pacaur' `pacman_frontend` with the name of the frontent:
```
If you have enabled color globally in *zpreztorc*, you may disable it for certain
commands.
To disable `yaourt` highlighting, add the following line to *zpreztorc*:
```sh ```sh
zstyle ':prezto:module:pacman:yaourt' color 'no' zstyle ':prezto:module:pacman' frontend 'pacman_frontend'
``` ```
Aliases Aliases
@ -50,28 +47,23 @@ Aliases
### Frontends ### Frontends
#### Yaourt
Note that there are currently potential security concerns relating to yaourt, so
other frontends are recommended.
- `pacc` manages *.pac\** files.
Functions Functions
--------- ---------
- `aurget` clone an aur package
- `pacman-list-explicit` lists explicitly installed pacman packages. - `pacman-list-explicit` lists explicitly installed pacman packages.
- `pacman-list-disowned` lists pacman disowned files. - `pacman-list-disowned` lists pacman disowned files.
Authors Authors
------- -------
*The authors of this module should be contacted via the [issue tracker][4].* *The authors of this module should be contacted via the [issue tracker][5].*
- [Benjamin Boudreau](https://github.com/dreur) - [Benjamin Boudreau](https://github.com/dreur)
- [Sorin Ionescu](https://github.com/sorin-ionescu) - [Sorin Ionescu](https://github.com/sorin-ionescu)
[1]: http://www.archlinux.org/pacman/ [1]: http://www.archlinux.org/pacman/
[2]: https://github.com/rmarquis/pacaur [2]: https://wiki.archlinux.org/index.php/AUR_helpers#Comparison_table
[3]: http://archlinux.fr/yaourt-en [3]: https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages
[4]: https://github.com/sorin-ionescu/prezto/issues [4]: https://github.com/AladW/aurutils
[5]: https://github.com/sorin-ionescu/prezto/issues

@ -23,10 +23,6 @@ zstyle -s ':prezto:module:pacman' frontend '_pacman_frontend'
if (( $+commands[$_pacman_frontend] )); then if (( $+commands[$_pacman_frontend] )); then
alias pacman="$_pacman_frontend" alias pacman="$_pacman_frontend"
if [[ -s "${0:h}/${_pacman_frontend}.zsh" ]]; then
source "${0:h}/${_pacman_frontend}.zsh"
fi
else else
_pacman_frontend='pacman' _pacman_frontend='pacman'
_pacman_sudo='sudo ' _pacman_sudo='sudo '
@ -81,4 +77,12 @@ fi
# upgrades outdated packages. # upgrades outdated packages.
alias pacU="${_pacman_sudo}${_pacman_frontend} --sync --refresh --sysupgrade" 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} 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'
Loading…
Cancel
Save