Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
ac0d7146
Commit
ac0d7146
authored
Jul 01, 2018
by
当轩
Committed by
Marc Cornellà
Jul 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add plugin:percol (#4582)
* add plugin:percol * fix format * check percol * fix empty history in gnome terminal
parent
55ab532e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
README.md
plugins/percol/README.md
+23
-0
percol.plugin.zsh
plugins/percol/percol.plugin.zsh
+22
-0
No files found.
plugins/percol/README.md
0 → 100644
View file @
ac0d7146
## percol
Provides some useful function to make
[
percol
](
https://github.com/mooz/percol
)
work with zsh history and
[
jump plugin
](
https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/jump/jump.plugin.zsh
)
### Preview

### Requirements
```
shell
pip
install
percol
```
And
[
jump
](
https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/jump/jump.plugin.zsh
)
for
`oh-my-zsh`
is a optional requirement.
### Usage
For default
-
`^-r`
bind to
`percol_select_history`
.You can use it to grep your history with percol.
-
`^-b`
bind to
`percol_select_marks`
.You can use it to grep your bookmarks with percol.
plugins/percol/percol.plugin.zsh
0 → 100644
View file @
ac0d7146
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
}
zle
-N
percol_select_history
bindkey
'^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
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment