diff --git a/modules/directory/init.zsh b/modules/directory/init.zsh index 47191dfe..8abc1e24 100644 --- a/modules/directory/init.zsh +++ b/modules/directory/init.zsh @@ -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_TO_HOME # Push to home directory when no argument is given. 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 EXTENDED_GLOB # Use extended globbing syntax. unsetopt CLOBBER # Do not overwrite existing files with > and >>. diff --git a/modules/editor/init.zsh b/modules/editor/init.zsh index ed57a102..085947ef 100644 --- a/modules/editor/init.zsh +++ b/modules/editor/init.zsh @@ -14,8 +14,7 @@ fi # Options # -# Beep on error in line editor. -setopt BEEP +setopt BEEP # Beep on error in line editor. # # Variables @@ -242,6 +241,27 @@ function 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. bindkey -d @@ -277,6 +297,12 @@ if (( $+widgets[history-incremental-pattern-search-backward] )); then history-incremental-pattern-search-forward 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 # @@ -296,6 +322,9 @@ else bindkey -M vicmd "/" history-incremental-search-forward fi +# Toggle comment at the start of the line. +bindkey -M vicmd "#" vi-pound-insert + # # Emacs and Vi Key Bindings # diff --git a/modules/environment/init.zsh b/modules/environment/init.zsh index 79e98a4a..4f3bbfe3 100644 --- a/modules/environment/init.zsh +++ b/modules/environment/init.zsh @@ -32,10 +32,11 @@ fi # General # -setopt COMBINING_CHARS # Combine zero-length punctuation characters (accents) - # with the base character. -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. +setopt COMBINING_CHARS # Combine zero-length punctuation characters (accents) + # with the base character. +setopt INTERACTIVE_COMMENTS # Enable comments in interactive shell. +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. # # Jobs diff --git a/modules/pacman/README.md b/modules/pacman/README.md index 855c8efa..a619a747 100644 --- a/modules/pacman/README.md +++ b/modules/pacman/README.md @@ -8,23 +8,20 @@ Settings -------- 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 -[Pacaur][2] or [Yaourt][3]). +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). -To enable a Pacman frontend, for example, [Pacaur][2], add the following line to -*zpreztorc*: +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. -```sh -zstyle ':prezto:module:pacman' frontend 'pacaur' -``` - -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*: +To enable a Pacman frontend, add the following line to *zpreztorc*, substituting +`pacman_frontend` with the name of the frontent: ```sh -zstyle ':prezto:module:pacman:yaourt' color 'no' +zstyle ':prezto:module:pacman' frontend 'pacman_frontend' ``` Aliases @@ -50,28 +47,23 @@ Aliases ### Frontends -#### Yaourt - -Note that there are currently potential security concerns relating to yaourt, so -other frontends are recommended. - - - `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][4].* +*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]: https://github.com/rmarquis/pacaur -[3]: http://archlinux.fr/yaourt-en -[4]: 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 diff --git a/modules/pacman/init.zsh b/modules/pacman/init.zsh index a5cacf2c..88c977f6 100644 --- a/modules/pacman/init.zsh +++ b/modules/pacman/init.zsh @@ -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 ' @@ -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} diff --git a/modules/pacman/yaourt.zsh b/modules/pacman/yaourt.zsh deleted file mode 100644 index 819fad16..00000000 --- a/modules/pacman/yaourt.zsh +++ /dev/null @@ -1,18 +0,0 @@ -# -# Defines Yaourt aliases. -# -# Authors: -# Sorin Ionescu -# - -# -# Aliases -# - -# Disable color. -if ! zstyle -t ':prezto:module:pacman:yaourt' color; then - alias pacman='yaourt --nocolor' -fi - -# Manages .pac* files. -alias pacc='yaourt -C'