[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
Provenance
- Commit
6081eac- Tree
3f3b477- Author
Junegunn Choi <junegunn.c@gmail.com>- Committer
Junegunn Choi <junegunn.c@gmail.com>- Parent
942ba74
3 files changed+18 added−18 removed
modified:shell/completion.bash+9 added-9 removed
12 unmodified lines13 # To use custom commands instead of find, override _fzf_compgen_{path,dir}14 if ! 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 }21 fi22 23 if ! 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 }29 fi77 unmodified lines107 $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 lines212 }213 214 _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 }220 221 _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 lines262 263 # Preserve existing completion264 if [ "$_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.3269 fi270 271 if type _completion_loader > /dev/null 2>&1; then43 unmodified linesmodified:shell/completion.zsh+8 added-8 removed
12 unmodified lines1314151617171819202122232425252627282946 unmodified lines7677787980808182838413 unmodified lines989910010110210210310410510610710710810911011111211311411511611411511611711811912074 unmodified lines12 unmodified lines# To use custom commands instead of find, override _fzf_compgen_{path,dir}if ! declare -f _fzf_compgen_path > /dev/null; then _fzf_compgen_path() { echo "$1" \find -L "$1" \ command find -L "$1" \ -name .git -prune -o -name .svn -prune -o \( -type d -o -type f -o -type l \) \ -a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@' }fi
if ! declare -f _fzf_compgen_dir > /dev/null; then _fzf_compgen_dir() { \find -L "$1" \ command find -L "$1" \ -name .git -prune -o -name .svn -prune -o -type d \ -a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@' }fi46 unmodified lines "" "/" ""}
_fzf_feed_fifo() ( rm -f "$1" command rm -f "$1" mkfifo "$1" cat <&0 > "$1" &)
13 unmodified lines LBUFFER="$lbuf$matches" fi zle redisplay typeset -f zle-line-init >/dev/null && zle zle-line-init rm -f "$fifo" command rm -f "$fifo"}
_fzf_complete_telnet() { _fzf_complete '+m' "$@" < <( \grep -v '^\s*\(#\|$\)' /etc/hosts | \grep -Fv '0.0.0.0' | command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0' | awk '{if (length($2) > 0) {print $2}}' | sort -u )}
_fzf_complete_ssh() { _fzf_complete '+m' "$@" < <( cat <(cat ~/.ssh/config /etc/ssh/ssh_config 2> /dev/null | \grep -i '^host' | \grep -v '*') \ <(\grep -oE '^[^ ]+' ~/.ssh/known_hosts | tr ',' '\n' | awk '{ print $1 " " $1 }') \ <(\grep -v '^\s*\(#\|$\)' /etc/hosts | \grep -Fv '0.0.0.0') | cat <(cat ~/.ssh/config /etc/ssh/ssh_config 2> /dev/null | command grep -i '^host' | command grep -v '*') \ <(command grep -oE '^[^ ]+' ~/.ssh/known_hosts | tr ',' '\n' | awk '{ print $1 " " $1 }') \ <(command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0') | awk '{if (length($2) > 0) {print $2}}' | sort -u )}
74 unmodified linesmodified:shell/key-bindings.bash+1 added-1 removed
50 unmodified lines51 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