commit 2891a384f5ff1be6da34ad11f2db49b0925144dd parent 59fb99bd625d8f63f634d5527e5521f496b772d7 Author: Alex Balgavy <a.balgavy@gmail.com> Date: Sun, 4 Aug 2019 23:31:56 +0200 commonprofile: use find for fzf editing functions With ls, directories would be listed twice. Former-commit-id: 7ccae4f6aa92e79e03d87affee527d7cb9fa287b Diffstat:
M | shell/commonprofile | | | 6 | +++--- |
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/shell/commonprofile b/shell/commonprofile @@ -283,19 +283,19 @@ if [ -f ~/.fzf.zsh ] || [ -f ~/.fzf.bash ]; then # script edit se() { local files - IFS=$'\n' files=($(command ls -d ~/.scripts/**/* | fzf -m --inline-info --prompt="edit> " --height=40 --reverse)) + IFS=$'\n' files=($(command find "$(readlink ~/.scripts)" -type f | fzf -m --inline-info --prompt="edit> " --height=40 --reverse)) [[ -n "$files" ]] && ${EDITOR:-vim} "${files[@]}" } # config edit ce() { local files - IFS=$'\n' files=($(command ls -d ~/.dotfiles/**/* | fzf -m --inline-info --prompt="edit> " --height=40 --reverse)) + IFS=$'\n' files=($(command find ~/.dotfiles -type f | fzf -m --inline-info --prompt="edit> " --height=40 --reverse)) [[ -n "$files" ]] && ${EDITOR:-vim} "${files[@]}" } # vim setting edit ve() { local files - IFS=$'\n' files=($(command ls -d ~/.dotfiles/vim/**/* | fzf -m --inline-info --prompt="edit> " --height=40 --reverse)) + IFS=$'\n' files=($(command find ~/.dotfiles/vim -type f | fzf -m --inline-info --prompt="edit> " --height=40 --reverse)) [[ -n "$files" ]] && ${EDITOR:-vim} "${files[@]}" } # run python