Skip to content
Myr

[shell] Add FZF_ALT_C_COMMAND for ALT-C (#408)

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

authored by Junegunn Choi · committed by Junegunn Choi · parent 15659ac · Browse files · 4 files+29 added−9 removed
This commit

State

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

Diff stats

4 files+29 added−9 removed

  • tests:+16 added−0 removed
  • other:+13 added−9 removed

4 files+29 added−9 removed

modified:shell/key-bindings.bash+5 added-4 removed
modified:shell/key-bindings.fish+4 added-2 removed
31 unmodified lines
32 rm -f $TMPDIR/fzf.result33 end3435 function __fzf_alt_c36 set -q FZF_ALT_C_COMMAND; or set -l FZF_ALT_C_COMMAND "37 command find -L . \\( -path '*/\\.*' -o -fstype 'dev' -o -fstype 'proc' \\) -prune \38 -o -type d -print 2> /dev/null | sed 1d | cut -b3-"39 # Fish hangs if the command before pipe redirects (2> /dev/null)37 command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) \38 -prune -o -type d -print 2> /dev/null | sed 1d | cut -b3- | eval (__fzfcmd) +m > $TMPDIR/fzf.result40 eval "$FZF_ALT_C_COMMAND | "(__fzfcmd)" +m > $TMPDIR/fzf.result"41 [ (cat $TMPDIR/fzf.result | wc -l) -gt 0 ]42 and cd (cat $TMPDIR/fzf.result)43 commandline -f repaint44 rm -f $TMPDIR/fzf.result
27 unmodified lines
modified:shell/key-bindings.zsh+4 added-3 removed
modified:test/test_go.rb+16 added
979 unmodified lines
980 tmux.send_keys :pwd, :Enter981 tmux.until { |lines| lines[-1].end_with?(expected) }982 end983984 def test_alt_c_command985 set_var 'FZF_ALT_C_COMMAND', 'echo /tmp'986987 tmux.prepare988 tmux.send_keys 'cd /', :Enter989990 tmux.prepare991 tmux.send_keys :Escape, :c, pane: 0992 lines = tmux.until(1) { |lines| lines.item_count == 1 }993 tmux.send_keys :Enter, pane: 1994995 tmux.prepare996 tmux.send_keys :pwd, :Enter997 tmux.until { |lines| lines[-1].end_with? '/tmp' }998 end9991000 def test_ctrl_r1001 tmux.prepare1002 tmux.send_keys 'echo 1st', :Enter; tmux.prepare1003 tmux.send_keys 'echo 2nd', :Enter; tmux.prepare
171 unmodified lines