Updated README.md (no manual installation, zstyles) and default Zstyles

This commit is contained in:
Sebastian Gniazdowski 2016-10-12 15:50:35 +02:00
parent 21384c6991
commit 6df72f0890
2 changed files with 8 additions and 13 deletions

View file

@ -76,21 +76,16 @@ psprint/history-search-multi-word` for testing before adding it to your
Add `zgen load psprint/history-search-multi-word` to your .zshrc file in the same
place you're doing your other `zgen load` calls in.
### Manual installation
## Customizing
Copy the file `history-search-multi-word` to your `site-functions` directory and add:
### Zstyles
```zsh
autoload history-search-multi-word
zle -N history-search-multi-word
zle -N history-search-multi-word-backwards history-search-multi-word
zle -N history-search-multi-word-pbackwards history-search-multi-word
zle -N history-search-multi-word-pforwards history-search-multi-word
bindkey "^R" history-search-multi-word
zstyle ":history-search-multi-word" page-size "8" # Number of entries to show, default is LINES/3
zstyle ":history-search-multi-word" highlight-color "fg=yellow,bold" # Color in which to highlight matched, searched text
zstyle ":plugin:history-search-multi-word" synhl "yes" # Whether to perform syntax highlighting
```
to your `~/zshrc`.
## IRC Channel
Channel `#zplugin@freenode` is a support place for all author's projects. Connect to:

View file

@ -11,8 +11,8 @@
# This will bind to Ctrl-R
#
# Zstyles:
# zstyle ":history-search-multi-word" page-size "5"
# zstyle ":history-search-multi-word" highlight-color "fg=magenta,bold"
# zstyle ":history-search-multi-word" page-size "8"
# zstyle ":history-search-multi-word" highlight-color "fg=yellow,bold"
# zstyle ":plugin:history-search-multi-word" synhl "yes"
emulate -LR zsh
@ -32,7 +32,7 @@ _hsmw_main() {
if [[ "$__hsmw_hcw_call_count" -le 1 || "$__hsmw_hcw_restart" = "1" ]]; then
if [[ "$__hsmw_hcw_call_count" -le 1 ]]; then
# Read configuration data
zstyle -s ':history-search-multi-word' page-size __hsmw_page_size || __hsmw_page_size=$(( LINES / 2 ))
zstyle -s ':history-search-multi-word' page-size __hsmw_page_size || __hsmw_page_size=$(( LINES / 3 ))
zstyle -s ':history-search-multi-word' highlight-color __hsmw_hl_color || __hsmw_hl_color="fg=yellow,bold"
zstyle -s ":plugin:history-search-multi-word" synhl __hsmw_synhl || __hsmw_synhl="yes"
[[ "$__hsmw_synhl" != "1" && "$__hsmw_synhl" != "yes" && "$__hsmw_synhl" != "true" ]] && __hsmw_synhl="no" || __hsmw_synhl="yes"