summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2016-07-07 01:40:14 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2016-07-07 01:40:14 +0900
commit6081eac58a0c1fe7cf920dc41d7d6ec07293b0ee (patch)
tree3f3b477c5b86caf31f3f1d81798e3fa7fc4f673f /shell
parent942ba749c7971076a650b899b4d44e0cced5f167 (diff)
[shell] Suppress alias/function expansion
Close #611
Diffstat (limited to 'shell')
-rw-r--r--shell/completion.bash18
-rw-r--r--shell/completion.zsh16
-rw-r--r--shell/key-bindings.bash2
3 files changed, 18 insertions, 18 deletions
diff --git a/shell/completion.bash b/shell/completion.bash
index a0040ce5..9436e271 100644
--- a/shell/completion.bash
+++ b/shell/completion.bash
@@ -14,7 +14,7 @@
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@^\./@@'
}
@@ -22,7 +22,7 @@ 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@^\./@@'
}
@@ -108,7 +108,7 @@ _fzf_handle_dynamic_completion() {
elif [ -n "$_fzf_completion_loader" ]; then
_completion_loader "$@"
ret=$?
- eval "$(complete | \grep "\-F.* $orig_cmd$" | _fzf_orig_completion_filter)"
+ eval "$(complete | command grep "\-F.* $orig_cmd$" | _fzf_orig_completion_filter)"
source "${BASH_SOURCE[0]}"
return $ret
fi
@@ -213,16 +213,16 @@ _fzf_complete_kill() {
_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
)
}
@@ -263,8 +263,8 @@ x_cmds="kill ssh telnet unset unalias export"
# Preserve existing completion
if [ "$_fzf_completion_loaded" != '0.11.3' ]; then
# Really wish I could use associative array but OSX comes with bash 3.2 :(
- eval $(complete | \grep '\-F' | \grep -v _fzf_ |
- \grep -E " ($(echo $d_cmds $a_cmds $x_cmds | sed 's/ /|/g' | sed 's/+/\\+/g'))$" | _fzf_orig_completion_filter)
+ eval $(complete | command grep '\-F' | command grep -v _fzf_ |
+ command grep -E " ($(echo $d_cmds $a_cmds $x_cmds | sed 's/ /|/g' | sed 's/+/\\+/g'))$" | _fzf_orig_completion_filter)
export _fzf_completion_loaded=0.11.3
fi
diff --git a/shell/completion.zsh b/shell/completion.zsh
index 003f5c19..1c803478 100644
--- a/shell/completion.zsh
+++ b/shell/completion.zsh
@@ -14,7 +14,7 @@
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@^\./@@'
}
@@ -22,7 +22,7 @@ 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@^\./@@'
}
@@ -77,7 +77,7 @@ _fzf_dir_completion() {
}
_fzf_feed_fifo() (
- rm -f "$1"
+ command rm -f "$1"
mkfifo "$1"
cat <&0 > "$1" &
)
@@ -99,21 +99,21 @@ _fzf_complete() {
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
)
}
diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash
index 3e9dc654..27b5d5fb 100644
--- a/shell/key-bindings.bash
+++ b/shell/key-bindings.bash
@@ -52,7 +52,7 @@ __fzf_history__() (
line=$(
HISTTIMEFORMAT= history |
eval "$(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r $FZF_CTRL_R_OPTS" |
- \grep '^ *[0-9]') &&
+ command grep '^ *[0-9]') &&
if [[ $- =~ H ]]; then
sed 's/^ *\([0-9]*\)\** .*/!\1/' <<< "$line"
else