diff options
| author | EuAndreh <eu@euandre.org> | 2021-01-12 16:01:48 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2021-01-12 16:01:48 -0300 |
| commit | 388a1823016706155e86e46dd6e9243519f1e035 (patch) | |
| tree | ac8f8ef0bb83b4872f9f737b4805b2e048e374fc /bash/util.sh | |
| parent | Add deliver-my-enqueued-emails cronjob (diff) | |
| download | dotfiles-388a1823016706155e86e46dd6e9243519f1e035.tar.gz dotfiles-388a1823016706155e86e46dd6e9243519f1e035.tar.xz | |
util.sh: fvi: Work on git repositories and support setup query string
Diffstat (limited to 'bash/util.sh')
| -rw-r--r-- | bash/util.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bash/util.sh b/bash/util.sh index 3658c8eb..f184723b 100644 --- a/bash/util.sh +++ b/bash/util.sh @@ -45,7 +45,11 @@ gen-password() { mkdir -p ~/.local/share/fzf/ touch ~/.local/share/fzf/fvi fvi() { - f="$(fzf --preview 'cat {}' --history=$HOME/.local/share/fzf/fvi)" + if [ -n "$(__git_ps1 '')" ]; then + f="$(git ls-files | fzf --query "$1" --preview 'cat {}' --history=$HOME/.local/share/fzf/fvi)" + else + f="$(fzf --query "$1" --preview 'cat {}' --history=$HOME/.local/share/fzf/fvi)" + fi if [ -n "$f" ]; then history -s vi "$f" vi "$f" |
