fzf: update to 0.9.13

This commit is contained in:
Dominik Honnef 2015-06-06 22:50:58 +02:00
parent d8b18b2ae3
commit 695e23bee8
6 changed files with 33 additions and 25 deletions

View File

@ -1,3 +1,7 @@
__fzfcmd() {
[ ${FZF_TMUX:-1} -eq 1 ] && echo "fzf-tmux -d${FZF_TMUX_HEIGHT:-40%}" || echo "fzf"
}
cd "${$(command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
-o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m):-.}"
-o -type d -print 2> /dev/null | sed 1d | cut -b3- | $(__fzfcmd) +m):-.}"
zle reset-prompt

View File

@ -1,13 +1,2 @@
if [ -n "$TMUX_PANE" -a ${FZF_TMUX:-1} -ne 0 -a ${LINES:-40} -gt 15 ]; then
local height
height=${FZF_TMUX_HEIGHT:-40%}
if [[ $height =~ %$ ]]; then
height="-p ${height%\%}"
else
height="-l $height"
fi
tmux split-window $height "cd $(printf %q "$PWD"); zsh -c 'tmux send-keys -t $TMUX_PANE \"\$(fzf-fsel)\"'"
else
LBUFFER="${LBUFFER}$(fzf-fsel)"
zle redisplay
fi
LBUFFER="${LBUFFER}$(fzf-fsel)"
zle redisplay

View File

@ -1,8 +1,12 @@
#!/bin/bash
__fzfcmd() {
[ ${FZF_TMUX:-1} -eq 1 ] && echo "fzf-tmux -d${FZF_TMUX_HEIGHT:-40%}" || echo "fzf"
}
command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
-o -type f -print \
-o -type d -print \
-o -type l -print 2> /dev/null | sed 1d | cut -b3- | fzf -m | while read item; do
-o -type l -print 2> /dev/null | sed 1d | cut -b3- | $(__fzfcmd) -m | while read item; do
printf '%q ' "$item"
done
echo

View File

@ -1,7 +1,18 @@
local selected
if selected=$(fc -l 1 | fzf +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r -q "$LBUFFER"); then
num=$(echo "$selected" | head -1 | awk '{print $1}' | sed 's/[^0-9]//g')
LBUFFER=!$num
zle expand-history
__fzfcmd() {
[ ${FZF_TMUX:-1} -eq 1 ] && echo "fzf-tmux -d${FZF_TMUX_HEIGHT:-40%}" || echo "fzf"
}
local selected restore_no_bang_hist
if selected=$(fc -l 1 | $(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r -q "$LBUFFER"); then
num=$(echo "$selected" | head -n1 | awk '{print $1}' | sed 's/[^0-9]//g')
if [ -n "$num" ]; then
LBUFFER=!$num
if setopt | grep nobanghist > /dev/null; then
restore_no_bang_hist=1
unsetopt no_bang_hist
fi
zle expand-history
[ -n "$restore_no_bang_hist" ] && setopt no_bang_hist
fi
fi
zle redisplay

View File

@ -3,7 +3,7 @@
@@ -1,15 +1,5 @@
# Key bindings
# ------------
-__fsel() {
-__fzf_select__() {
- command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
- -o -type f -print \
- -o -type d -print \

View File

@ -1,9 +1,9 @@
# Template file for 'fzf'
pkgname=fzf
version=0.9.10
version=0.9.13
revision=1
_version=${version}
wrksrc=${pkgname}-${_version}
revision=1
build_style=go
go_import_path="github.com/junegunn/fzf/src"
go_package="github.com/junegunn/fzf/src/fzf"
@ -14,7 +14,7 @@ license="MIT"
homepage="https://github.com/junegunn/fzf"
short_desc="A command-line fuzzy finder"
distfiles="https://github.com/junegunn/fzf/archive/${_version}.tar.gz"
checksum=f5492ec1f8cce4c78d480ad3edd4e077df17109cde7bf5ade6f11135ce65aee3
checksum=0a9972482f57dddf0d7c72e21d13d664ad9b8ee0535bdaab60bb0db3f0ca14c3
# Needs cgo to build, which doesn't work when cross-compiling.
nocross=yes
@ -30,7 +30,7 @@ post_install() {
vman man/man1/fzf.1
sed -i -e 's#source ~/\.fzf\.bash; ##' shell/key-bindings.bash
sed -i -e 's/(__fsel)/(fzf-fsel)/' shell/key-bindings.bash
sed -i -e 's/(__fzf_select__)/(fzf-fsel)/' shell/key-bindings.bash
vinstall plugin/fzf.vim 644 usr/share/vim/vimfiles/plugin
vinstall shell/completion.bash 644 usr/share/bash-completion/completions fzf
vinstall ${FILESDIR}/fzf-file-widget 644 usr/share/zsh/site-functions