diff options
author | luxagraf <sng@luxagraf.net> | 2020-07-15 09:29:55 -0400 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2020-07-15 09:29:55 -0400 |
commit | 768a4df311c1a0b296481860258a7f58d3a87fa6 (patch) | |
tree | 2e0b10a24ebc607b9bdfcc727f99f802ee89348d /bin/fuz | |
parent | fe4d14419e52e4afbc2a7feefdc34cae2f30a3e1 (diff) |
added latest tweaks to my setup
Diffstat (limited to 'bin/fuz')
-rwxr-xr-x | bin/fuz | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -e + +main() { + previous_file="$1" + file_to_edit=`select_file $previous_file` + + if [ -n "$file_to_edit" ] ; then + "$EDITOR" "$file_to_edit" + main "$file_to_edit" + fi +} + +select_file() { + given_file="$1" + fzf --preview="bat {}" --preview-window=right:70%:wrap --query="$given_file" +} + +main "" |