mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-22 12:55:17 +00:00
Add zsh widget examples
This commit is contained in:
parent
75b666bf54
commit
11a1010e9e
24
README.md
24
README.md
@ -169,6 +169,30 @@ bind '"\C-t": " \C-u \C-a\C-k$(fzf)\e\C-e\C-y\C-a\C-y\ey\C-h\C-e\er"'
|
|||||||
bind '"\C-r": " \C-e\C-u$(history | fzf +s | sed \"s/ *[0-9]* *//\")\e\C-e\er"'
|
bind '"\C-r": " \C-e\C-u$(history | fzf +s | sed \"s/ *[0-9]* *//\")\e\C-e\er"'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
zsh widgets
|
||||||
|
-----------
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# CTRL-T - Paste the selected file path into the command line
|
||||||
|
fzf-file-widget() {
|
||||||
|
LBUFFER+=$(
|
||||||
|
find * -path '*/\\.*' -prune \
|
||||||
|
-o -type f -print \
|
||||||
|
-o -type l -print 2> /dev/null | fzf)
|
||||||
|
zle redisplay
|
||||||
|
}
|
||||||
|
zle -N fzf-file-widget
|
||||||
|
bindkey '^T' fzf-file-widget
|
||||||
|
|
||||||
|
# CTRL-R - Paste the selected command from history into the command line
|
||||||
|
fzf-history-widget() {
|
||||||
|
LBUFFER+=$(history | fzf +s | sed "s/ *[0-9]* *//")
|
||||||
|
zle redisplay
|
||||||
|
}
|
||||||
|
zle -N fzf-history-widget
|
||||||
|
bindkey '^R' fzf-history-widget
|
||||||
|
```
|
||||||
|
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user