Exclude sysfs in find commands
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 c82fb3c · Browse files · 4 files·+7 added−7 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+7 added−7 removed
- other:+7 added−7 removed
Provenance
- Commit
11407bf- Tree
93df809- Author
Junegunn Choi <junegunn.c@gmail.com>- Committer
Junegunn Choi <junegunn.c@gmail.com>- Parent
c82fb3c
4 files changed+7 added−7 removed
modified:shell/key-bindings.bash+2 added-2 removed
12344567836 unmodified lines4546474849495051525368 unmodified lines# Key bindings# ------------__fzf_select__() { local cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ 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 \ -o -type f -print \ -o -type d -print \ -o -type l -print 2> /dev/null | cut -b3-"}" eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS" fzf -m "$@" | while read -r item; do36 unmodified lines}
__fzf_cd__() { local cmd dir cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ -o -type d -print 2> /dev/null | cut -b3-"}" dir=$(eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS" $(__fzfcmd) +m) && printf 'cd %q' "$dir"}
68 unmodified linesmodified:shell/key-bindings.fish+2 added-2 removed
14 unmodified lines15 16 # "-path \$dir'*/\\.*'" matches hidden files/folders inside $dir but not17 # $dir itself, even if hidden.18 set -q FZF_CTRL_T_COMMAND; or set -l FZF_CTRL_T_COMMAND "19- command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \19+ command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \20 -o -type f -print \21 -o -type d -print \22 -o -type l -print 2> /dev/null | cut -b3-"23 29 unmodified lines53 end54 55 function fzf-cd-widget -d "Change directory"56 set -q FZF_ALT_C_COMMAND; or set -l FZF_ALT_C_COMMAND "57- command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \57+ command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \58 -o -type d -print 2> /dev/null | cut -b3-"59 set -q FZF_TMUX_HEIGHT; or set FZF_TMUX_HEIGHT 40%60 begin61 set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT --reverse $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS"26 unmodified linesmodified:shell/key-bindings.zsh+2 added-2 removed
2 unmodified lines3 if [[ $- == *i* ]]; then4 5 # CTRL-T - Paste the selected file path(s) into the command line6 __fsel() {7- local cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \7+ 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 \8 -o -type f -print \9 -o -type d -print \10 -o -type l -print 2> /dev/null | cut -b3-"}"11 setopt localoptions pipefail 2> /dev/null25 unmodified lines37 bindkey '^T' fzf-file-widget38 39 # ALT-C - cd into the selected directory40 fzf-cd-widget() {41- local cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \41+ local cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \42 -o -type d -print 2> /dev/null | cut -b3-"}"43 setopt localoptions pipefail 2> /dev/null44 local dir="$(eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS" $(__fzfcmd) +m)"45 if [[ -z "$dir" ]]; then33 unmodified linesmodified:src/constants_unix.go+1 added-1 removed
2 unmodified lines3 package fzf4 5 const (6 // Reader7- defaultCommand = `find -L . -path '*/\.*' -prune -o -type f -print -o -type l -print 2> /dev/null | cut -b3-`7+ defaultCommand = `command find -L . -mindepth 1 \( -path '*/\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \) -prune -o -type f -print -o -type l -print 2> /dev/null | cut -b3-`8 )