Skip to content
Myr

Merge pull request #5 from Vifon/zsh-widgets

Before adoption: this commit came in with the history the project adopted, so no landing records it.

new zsh widgets

authored by Junegunn Choi · committed by Junegunn Choi · parents 1e9e597, b2ac524 · Browse files · 1 file+21 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+21 added−6 removed

  • other:+21 added−6 removed

1 file+21 added−6 removed

modified:README.md+21 added-6 removed
175 unmodified lines
176zsh widgets177-----------178179```sh180# CTRL-T - Paste the selected file path into the command line180# CTRL-T - Paste the selected file(s) path into the command line181fzf-file-widget() {182 local FILES183 local IFS="184"182 LBUFFER+=$(183 find * -path '*/\.*' -prune \184 -o -type f -print \185 -o -type l -print 2> /dev/null | fzf)185 FILES=($(186 find * -path '*/\.*' -prune \187 -o -type f -print \188 -o -type l -print 2> /dev/null | fzf -m))189 unset IFS190 FILES=$FILES:q191 LBUFFER="${LBUFFER%% #} $FILES"192 zle redisplay193}194zle -N fzf-file-widget195bindkey '^T' fzf-file-widget196197# ALT-C - cd into the selected directory198fzf-cd-widget() {199 cd "${$(find * -path '*/\.*' -prune \200 -o -type d -print 2> /dev/null | fzf):-.}"201 zle reset-prompt202}203zle -N fzf-cd-widget204bindkey '\ec' fzf-cd-widget205206# CTRL-R - Paste the selected command from history into the command line207fzf-history-widget() {193 LBUFFER+=$(history | fzf +s | sed "s/ *[0-9]* *//")208 LBUFFER=$(history | fzf +s | sed "s/ *[0-9]* *//")209 zle redisplay210}211zle -N fzf-history-widget212bindkey '^R' fzf-history-widget
38 unmodified lines