Skip to content
Myr

[shell] Suppress alias/function expansion

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

Close #611

authored by Junegunn Choi · committed by Junegunn Choi · parent 942ba74 · Browse files · 3 files+18 added−18 removed
This commit

State

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

Diff stats

3 files+18 added−18 removed

  • other:+18 added−18 removed

3 files+18 added−18 removed

modified:shell/completion.bash+9 added-9 removed
12 unmodified lines
13# To use custom commands instead of find, override _fzf_compgen_{path,dir}14if ! declare -f _fzf_compgen_path > /dev/null; then15 _fzf_compgen_path() {16 echo "$1"17 \find -L "$1" \17 command find -L "$1" \18 -name .git -prune -o -name .svn -prune -o \( -type d -o -type f -o -type l \) \19 -a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@'20 }21fi2223if ! declare -f _fzf_compgen_dir > /dev/null; then24 _fzf_compgen_dir() {25 \find -L "$1" \25 command find -L "$1" \26 -name .git -prune -o -name .svn -prune -o -type d \27 -a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@'28 }29fi
77 unmodified lines
107 $orig "$@"108 elif [ -n "$_fzf_completion_loader" ]; then109 _completion_loader "$@"110 ret=$?111 eval "$(complete | \grep "\-F.* $orig_cmd$" | _fzf_orig_completion_filter)"111 eval "$(complete | command grep "\-F.* $orig_cmd$" | _fzf_orig_completion_filter)"112 source "${BASH_SOURCE[0]}"113 return $ret114 fi115}
96 unmodified lines
212}213214_fzf_complete_telnet() {215 _fzf_complete '+m' "$@" < <(216 \grep -v '^\s*\(#\|$\)' /etc/hosts | \grep -Fv '0.0.0.0' |216 command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0' |217 awk '{if (length($2) > 0) {print $2}}' | sort -u218 )219}220221_fzf_complete_ssh() {222 _fzf_complete '+m' "$@" < <(223 cat <(cat ~/.ssh/config /etc/ssh/ssh_config 2> /dev/null | \grep -i '^host' | \grep -v '*') \224 <(\grep -oE '^[^ ]+' ~/.ssh/known_hosts | tr ',' '\n' | awk '{ print $1 " " $1 }') \225 <(\grep -v '^\s*\(#\|$\)' /etc/hosts | \grep -Fv '0.0.0.0') |223 cat <(cat ~/.ssh/config /etc/ssh/ssh_config 2> /dev/null | command grep -i '^host' | command grep -v '*') \224 <(command grep -oE '^[^ ]+' ~/.ssh/known_hosts | tr ',' '\n' | awk '{ print $1 " " $1 }') \225 <(command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0') |226 awk '{if (length($2) > 0) {print $2}}' | sort -u227 )228}229
32 unmodified lines
262263# Preserve existing completion264if [ "$_fzf_completion_loaded" != '0.11.3' ]; then265 # Really wish I could use associative array but OSX comes with bash 3.2 :(266 eval $(complete | \grep '\-F' | \grep -v _fzf_ |267 \grep -E " ($(echo $d_cmds $a_cmds $x_cmds | sed 's/ /|/g' | sed 's/+/\\+/g'))$" | _fzf_orig_completion_filter)266 eval $(complete | command grep '\-F' | command grep -v _fzf_ |267 command grep -E " ($(echo $d_cmds $a_cmds $x_cmds | sed 's/ /|/g' | sed 's/+/\\+/g'))$" | _fzf_orig_completion_filter)268 export _fzf_completion_loaded=0.11.3269fi270271if type _completion_loader > /dev/null 2>&1; then
43 unmodified lines
modified:shell/completion.zsh+8 added-8 removed
modified:shell/key-bindings.bash+1 added-1 removed
50 unmodified lines
51 shopt -u nocaseglob nocasematch52 line=$(53 HISTTIMEFORMAT= history |54 eval "$(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r $FZF_CTRL_R_OPTS" |55 \grep '^ *[0-9]') &&55 command grep '^ *[0-9]') &&56 if [[ $- =~ H ]]; then57 sed 's/^ *\([0-9]*\)\** .*/!\1/' <<< "$line"58 else59 sed 's/^ *\([0-9]*\)\** *//' <<< "$line"
66 unmodified lines