diff options
| author | EuAndreh <eu@euandre.org> | 2021-01-16 23:09:32 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2021-01-16 23:19:44 -0300 |
| commit | 4c7a9f5bf3563781d8093ffe86896057eab84265 (patch) | |
| tree | b5ce295b49b43493e3ae979d3a6a436b2c1495ef | |
| parent | Remove unused git/gitlab-ci.yml (diff) | |
| download | dotfiles-4c7a9f5bf3563781d8093ffe86896057eab84265.tar.gz dotfiles-4c7a9f5bf3563781d8093ffe86896057eab84265.tar.xz | |
bash/fzf.sh: Add v() fn
| -rw-r--r-- | bash/aliases.sh | 1 | ||||
| -rw-r--r-- | bash/fzf.sh | 19 |
2 files changed, 19 insertions, 1 deletions
diff --git a/bash/aliases.sh b/bash/aliases.sh index 6d8e4b77..97e22a58 100644 --- a/bash/aliases.sh +++ b/bash/aliases.sh @@ -38,7 +38,6 @@ alias r="source ~/.bashrc" alias ag="ag --hidden" alias jk-shell="bundix && nix-shell -E '((import <nixpkgs> {}).bundlerEnv { name=\"jekyll-env\"; gemdir = ./.; }).env'" alias grep='grep --color=always' -alias td='vi ~/Sync/TODOs.md' # https://linuxhandbook.com/run-alias-as-sudo/ alias sudo='sudo ' diff --git a/bash/fzf.sh b/bash/fzf.sh index f7640b80..8894c9b1 100644 --- a/bash/fzf.sh +++ b/bash/fzf.sh @@ -54,3 +54,22 @@ f() { "$1" "$file" fi } + +V_FILES=' +Sync/TODOs.md +annex/txt/things.md +tmp/scratch.txt +annex/bin/misc/git/mrconfig.ini +archive/vlc/playlist.txt +dev/libre/others/dinheiros/money.ledger +' + +v() { + f="$(echo "$V_FILES" | awk /./ | fzf-tmux --select-1 --exit-0 --query "$1")" + if [ -n "$f" ]; then + history -s v $@ + history -s vi "$f" + echo "$f" + vi "$HOME/$f" + fi +} |
