File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 39
39
40
40
{
41
41
42
- # CTRL-T - Paste the selected file path(s) into the command line
42
+ # CTRL-T - Paste the selected file path(s) into the command line using the last part of the buffer as fzf query
43
43
__fsel () {
44
44
local cmd=" ${FZF_CTRL_T_COMMAND:- " command find -L . -mindepth 1 \\ ( -path '*/.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\ ) -prune \
45
45
-o -type f -print \
46
46
-o -type d -print \
47
47
-o -type l -print 2> /dev/null | cut -b3-" }"
48
48
setopt localoptions pipefail no_aliases 2> /dev/null
49
49
local item
50
- eval " $cmd " | FZF_DEFAULT_OPTS=" --height ${FZF_TMUX_HEIGHT:- 40% } --reverse --scheme=path --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} ${FZF_CTRL_T_OPTS-} " $( __fzfcmd) -m " $@ " | while read item; do
50
+ local -a words=(${(z)LBUFFER} )
51
+ local query=${words[-1]}
52
+ eval " $cmd " | FZF_DEFAULT_OPTS=" --height ${FZF_TMUX_HEIGHT:- 40% } --reverse --scheme=path --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} ${FZF_CTRL_T_OPTS-} " $( __fzfcmd) -m --query=${query} | while read item; do
51
53
echo -n " ${(q)item} "
52
54
done
53
55
local ret=$?
You can’t perform that action at this time.
0 commit comments