forked from ohmyzsh/ohmyzsh
-
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.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
25 changed files
with
100 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,7 +68,7 @@ plugins=( | |
git | ||
bundler | ||
dotenv | ||
osx | ||
macos | ||
rake | ||
rbenv | ||
ruby | ||
|
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
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
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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 @@ | ||
macos.plugin.zsh |
File renamed without changes.
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 @@ | ||
macos |
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 |
---|---|---|
@@ -1,20 +1,23 @@ | ||
## percol | ||
# percol | ||
|
||
Provides some useful function to make [percol](https://github.com/mooz/percol) work with zsh history and [jump plugin](https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/jump/jump.plugin.zsh) | ||
Provides some useful function to make [percol](https://github.com/mooz/percol) work with zsh history and | ||
the [jump plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/jump), optionally. | ||
|
||
### Requirements | ||
To use it, add `percol` to the plugins array in your zshrc: | ||
|
||
```shell | ||
pip install percol | ||
```zsh | ||
plugins=(... percol) | ||
``` | ||
|
||
And [jump](https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/jump/jump.plugin.zsh) for `oh-my-zsh` is a optional requirement. | ||
## Requirements | ||
|
||
### Usage | ||
- `percol`: install with `pip install percol`. | ||
|
||
For default | ||
- (_Optional_) [`jump`](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/jump) plugin: needs to be | ||
enabled before the `percol` plugin. | ||
|
||
- `^-r` bind to `percol_select_history`.You can use it to grep your history with percol. | ||
## Usage | ||
|
||
- `^-b` bind to `percol_select_marks`.You can use it to grep your bookmarks with percol. | ||
- <kbd>CTRL-R</kbd> (bound to `percol_select_history`): you can use it to grep your history with percol. | ||
|
||
- <kbd>CTRL-B</kbd> (bound to `percol_select_marks`): you can use it to grep your jump bookmarks with percol. |
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 |
---|---|---|
@@ -1,22 +1,25 @@ | ||
if which percol &> /dev/null; then | ||
function percol_select_history() { | ||
local tac | ||
which gtac &> /dev/null && tac="gtac" || { which tac &> /dev/null && tac="tac" || { tac="tail -r" } } | ||
BUFFER=$(fc -l -n 1 | eval $tac | percol --query "$LBUFFER") | ||
CURSOR=$#BUFFER | ||
zle -R -c | ||
} | ||
(( ${+commands[percol]} )) || return | ||
|
||
zle -N percol_select_history | ||
bindkey '^R' percol_select_history | ||
function percol_select_history() { | ||
# print history in reverse order (from -1 (latest) to 1 (oldest)) | ||
BUFFER=$(fc -l -n -1 1 | percol --query "$LBUFFER") | ||
CURSOR=$#BUFFER | ||
zle -R -c | ||
} | ||
zle -N percol_select_history | ||
bindkey -M emacs '^R' percol_select_history | ||
bindkey -M viins '^R' percol_select_history | ||
bindkey -M vicmd '^R' percol_select_history | ||
|
||
if which marks &> /dev/null; then | ||
function percol_select_marks() { | ||
BUFFER=$(marks | percol --query "$LBUFFER" | awk '{print $3}') | ||
CURSOR=$#BUFFER # move cursor | ||
zle -R -c # refresh | ||
} | ||
zle -N percol_select_marks | ||
bindkey '^B' percol_select_marks | ||
fi | ||
if (( ${+functions[marks]} )); then | ||
function percol_select_marks() { | ||
# parse directory from marks output (markname -> path) and quote if necessary | ||
BUFFER=${(q)"$(marks | percol --query "$LBUFFER")"##*-> } | ||
CURSOR=$#BUFFER | ||
zle -R -c | ||
} | ||
zle -N percol_select_marks | ||
bindkey -M emacs '^B' percol_select_marks | ||
bindkey -M viins '^B' percol_select_marks | ||
bindkey -M vicmd '^B' percol_select_marks | ||
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
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
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
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