aboutsummaryrefslogtreecommitdiff
path: root/etc/bash
diff options
context:
space:
mode:
Diffstat (limited to 'etc/bash')
-rw-r--r--etc/bash/rc31
1 files changed, 16 insertions, 15 deletions
diff --git a/etc/bash/rc b/etc/bash/rc
index aaeec1e..0dbca5a 100644
--- a/etc/bash/rc
+++ b/etc/bash/rc
@@ -173,22 +173,23 @@ f() {
fi
}
-V_FILES="$(echo "
-~/Documents/txt/TODOs.md
-~/Documents/txt/scratch.txt
-$XDG_CONFIG_HOME/bash/rc
-$XDG_CONFIG_HOME/guix/home.scm
-$XDG_CONFIG_HOME/guix/system.scm
-$(find ~/Documents/txt/*.md -not -name TODOs.md |
- sed "s|^$HOME|~|" |
- LANG=POSIX.UTF-8 sort)
-~/dev/libre/package-repository/dependencies.dot
-~/dev/others/dinheiros/dinheiros.ledger
-~/dev/libre/dotfiles/sh/fake-symlinks.sh
-$XDG_CONFIG_HOME/guix/channels.scm
-" | tr ' ' '\n' | grep . | sed 's|^/home/andreh|~|')"
-
v() {
+ V_FILES="$(
+ cat <<-EOF | sed "s|$HOME|~|"
+ ~/Documents/txt/TODOs.md
+ ~/Documents/txt/scratch.txt
+ $XDG_CONFIG_HOME/bash/rc
+ $XDG_CONFIG_HOME/guix/home.scm
+ $XDG_CONFIG_HOME/guix/system.scm
+ $(find ~/Documents/txt/*.md -not -name TODOs.md |
+ sed "s|^$HOME|~|" |
+ LANG=POSIX.UTF-8 sort)
+ ~/dev/libre/package-repository/dependencies.dot
+ ~/dev/others/dinheiros/dinheiros.ledger
+ ~/dev/libre/dotfiles/sh/fake-symlinks.sh
+ $XDG_CONFIG_HOME/guix/channels.scm
+ EOF
+ )"
f="$(echo "$V_FILES" | fzf --select-1 --exit-0 --query "$1")"
if [ -n "$f" ]; then
history -s v "$@"