1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-12-21 15:57:59 +00:00

Integrate zaw into Prezto

This commit is contained in:
Sorin Ionescu 2014-10-09 01:33:12 -04:00
parent 36ade25eb6
commit 8e95c547d6
6 changed files with 184 additions and 0 deletions

3
.gitmodules vendored
View File

@ -7,3 +7,6 @@
[submodule "modules/completion/external"]
path = modules/completion/external
url = https://github.com/zsh-users/zsh-completions.git
[submodule "modules/zaw/external"]
path = modules/zaw/external
url = git://github.com/zsh-users/zaw.git

View File

@ -193,3 +193,8 @@ Yum
Defines yum aliases.
Zaw
---
Integrates zaw into Prezto.

77
modules/zaw/README.md Normal file
View File

@ -0,0 +1,77 @@
Zaw
===
Loads and configures Zaw from the [zaw][1] project.
Contributors
------------
New features and bug fixes should be submitted to the [zaw][1] project according
to its rules and regulations. This module will be synchronized against it.
Settings
--------
### Case Sensitivity
To enable case-sensitivity for this module only, add the following line to
*zpreztorc*:
zstyle ':prezto:module:zaw' case-sensitive 'yes'
### Highlighting
If colors are enabled, *zaw* will automatically highlight positive results.
To enable highlighting for this module only, add the following line to
*zpreztorc*:
zstyle ':prezto:module:zaw' color 'yes'
To change the error color, add the following line to *zpreztorc*:
zstyle ':prezto:module:zaw:color' error 'bg=red,fg=white'
To change the marked item color, add the following line to *zpreztorc*:
zstyle ':prezto:module:zaw:color' marked 'bg=blue,fg=white'
To change the matched item color, add the following line to *zpreztorc*:
zstyle ':prezto:module:zaw:color' matched 'bg=magenta,fg=white'
To change the selected item color, add the following line to *zpreztorc*:
zstyle ':prezto:module:zaw:color' selected 'standout'
To change the list title color, add the following line to *zpreztorc*:
zstyle ':prezto:module:zaw:color' title 'fg=yellow'
# Search
To set the maximum number of items, add the following line to *zpreztorc*:
zstyle ':prezto:module:zaw' max-lines 15
To rotate to the other side of the list when the cursor reaches the top or the
bottom, add the following line to *zpreztorc*:
zstyle ':filter-select' rotate-list 'yes'
To use extended search operators, add the following line to *zpreztorc*:
zstyle ':prezto:module:zaw' extended-search 'yes'
More details can be found in the [zaw][1] project's README.
Authors
-------
*The authors of this module should be contacted via the [issue tracker][2].*
- [Sorin Ionescu](https://github.com/sorin-ionescu)
[1]: https://github.com/zsh-users/zaw
[2]: https://github.com/sorin-ionescu/prezto/issues

1
modules/zaw/external Submodule

@ -0,0 +1 @@
Subproject commit c3308b675de18a14c933544077a429ba94ea7101

69
modules/zaw/init.zsh Normal file
View File

@ -0,0 +1,69 @@
#
# Integrates zaw into Prezto.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Load dependencies.
pmodload 'editor'
# Source module files.
source "${0:h}/external/zaw.zsh" || return 1
#
# Highlighting
#
zstyle -s ':prezto:module:zaw:color' error 'REPLY' || REPLY='bg=red,fg=white'
zstyle ':filter-select:highlight' error "$REPLY"
zstyle -s ':prezto:module:zaw:color' marked 'REPLY' || REPLY='bg=blue,fg=white'
zstyle ':filter-select:highlight' marked "$REPLY"
zstyle -s ':prezto:module:zaw:color' matched 'REPLY' || REPLY='bg=magenta,fg=white'
zstyle ':filter-select:highlight' matched "$REPLY"
zstyle -s ':prezto:module:zaw:color' selected 'REPLY' || REPLY='standout'
zstyle ':filter-select:highlight' selected "$REPLY"
zstyle -s ':prezto:module:zaw:color' title 'REPLY' || REPLY='fg=yellow'
zstyle ':filter-select:highlight' title "$REPLY"
if ! zstyle -t ':prezto:module:zaw' color; then
for style in error marked matched selected title; do
zstyle -d ':filter-select:highlight' "$style"
done
fi
#
# Search
#
zstyle -s ':prezto:module:zaw' max-lines 'REPLY' || REPLY=0
zstyle ':filter-select' max-lines "$REPLY"
zstyle -b ':filter-select' rotate-list 'REPLY' || REPLY='no'
zstyle ':filter-select' rotate-list "$REPLY"
zstyle -b ':prezto:module:zaw' extended-search 'REPLY' || REPLY='no'
zstyle ':filter-select' extended-search "$REPLY"
if ! zstyle -t ':prezto:module:zaw' case-sensitive; then
zstyle ':filter-select' case-insensitive 'yes'
fi
#
# Key Bindings
#
if [[ -n "$key_info" ]]; then
# Emacs
bindkey -M emacs "$key_info[Control]R" zaw-history
bindkey -M emacs "$key_info[Control]S" zaw-history
# Vi
bindkey -M vicmd "/" zaw-history
bindkey -M vicmd "?" zaw-history
fi

View File

@ -152,3 +152,32 @@ zstyle ':prezto:module:prompt' theme 'sorin'
# Auto start a session when Zsh is launched in a SSH connection.
# zstyle ':prezto:module:tmux:auto-start' remote 'yes'
#
# Zaw
#
# Set the error color.
# zstyle ':prezto:module:zaw:color' error 'bg=red,fg=white'
# Set the marked item color.
# zstyle ':prezto:module:zaw:color' marked 'bg=blue,fg=white'
# Set the matched item color.
# zstyle ':prezto:module:zaw:color' matched 'bg=magenta,fg=white'
# Set the selected item color.
# zstyle ':prezto:module:zaw:color' selected 'standout'
# Set the list title color.
# zstyle ':prezto:module:zaw:color' title 'fg=yellow'
# Set the maximum number of items.
# zstyle ':prezto:module:zaw' max-lines 15
# Set list cursor rotation.
# zstyle ':filter-select' rotate-list 'yes'
# Enable extended search operators.
# zstyle ':prezto:module:zaw' extended-search 'yes'