forked from sorin-ionescu/prezto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix sorin-ionescu#532] Integrate autosuggestions
- Loading branch information
1 parent
8bd720b
commit c8b8397
Showing
6 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
Autosuggestions | ||
--------------- | ||
|
||
Integrates zsh-autosuggestions into Prezto. | ||
|
||
Autosuggestions | ||
=============== | ||
|
||
Integrates [zsh-autosuggestions][1] into Prezto, which implements the | ||
[Fish shell][2]'s autosuggestions feature, where the user can type in any part | ||
of a previously entered command and Zsh suggests commands as you type based on | ||
history and completions. | ||
|
||
If this module is used in conjuncture with the *syntax-highlighting* module, it | ||
must be loaded **after** it. | ||
|
||
If this module is used in conjuncture with the *history-substring-search* | ||
module, it must be loaded **after** it. | ||
|
||
Contributors | ||
------------ | ||
|
||
New features and bug fixes should be submitted to the [zsh-autosuggestions][1] | ||
project according to its rules and regulations. This module will be synchronized | ||
against it. | ||
|
||
Settings | ||
-------- | ||
|
||
### Highlighting | ||
|
||
If colors are enabled, *autosuggestions* will automatically highlight | ||
positive results. | ||
|
||
To enable highlighting for this module only, add the following line to | ||
*zpreztorc*: | ||
|
||
zstyle ':prezto:module:autosuggestions' color 'yes' | ||
|
||
To set the query found color, add the following line to *zpreztorc*: | ||
|
||
zstyle ':prezto:module:autosuggestions:color' found '' | ||
|
||
Authors | ||
------- | ||
|
||
*The authors of this module should be contacted via the [issue tracker][3].* | ||
|
||
- [Sorin Ionescu](https://github.com/sorin-ionescu) | ||
|
||
[1]: https://github.com/tarruda/zsh-autosuggestions | ||
[2]: http://fishshell.com | ||
[3]: https://github.com/sorin-ionescu/prezto/issues |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# | ||
# Integrates zsh-autosuggestions into Prezto. | ||
# | ||
# Authors: | ||
# Sorin Ionescu <[email protected]> | ||
# | ||
|
||
# Load dependencies. | ||
pmodload 'editor' | ||
|
||
# Source module files. | ||
source "${0:h}/external/zsh-autosuggestions.zsh" || return 1 | ||
|
||
# | ||
# Highlighting | ||
# | ||
|
||
# Set highlight color, default 'fg=8'. | ||
zstyle -s ':prezto:module:autosuggestions:color' found \ | ||
'ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE' || ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8' | ||
|
||
# Disable highlighting. | ||
if ! zstyle -t ':prezto:module:autosuggestions' color; then | ||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='' | ||
fi | ||
|
||
# | ||
# Key Bindings | ||
# | ||
|
||
if [[ -n "$key_info" ]]; then | ||
# vi | ||
bindkey -M viins "$key_info[Control]F" vi-forward-word | ||
bindkey -M viins "$key_info[Control]E" vi-add-eol | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters