File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 3939
4040{
4141
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
4343__fsel () {
4444 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 \
4545 -o -type f -print \
4646 -o -type d -print \
4747 -o -type l -print 2> /dev/null | cut -b3-" }"
4848 setopt localoptions pipefail no_aliases 2> /dev/null
4949 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
5153 echo -n " ${(q)item} "
5254 done
5355 local ret=$?
You can’t perform that action at this time.
0 commit comments