summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2018-10-23 17:45:09 +1100
committerDylan Araps <dylan.araps@gmail.com>2018-10-23 17:45:09 +1100
commitf5e2c55dbcead2b583a8dcf1a5d2a55a5c383c71 (patch)
tree690215c21ff7d30fecf45cf3e01e1f400069c2f7
parent0c43aafb04c599abadec085721abe1c835f8de5a (diff)
allow user to set editor and opener
-rw-r--r--README.md5
-rwxr-xr-xfff4
-rw-r--r--fff.15
3 files changed, 10 insertions, 4 deletions
diff --git a/README.md b/README.md
index 7584f96..caf56eb 100644
--- a/README.md
+++ b/README.md
@@ -75,7 +75,10 @@ export FFF_COL2=7
export FFF_COL3=6
# Text Editor
-export EDITOR="cmd"
+export FFF_EDITOR="vim" # alternative: export EDITOR="vim"
+
+# File Opener
+export FFF_OPENER="xdg-open"
# Favourites (keys 1-9) (dir or file)
export FFF_FAV1=~/projects
diff --git a/fff b/fff
index 57ed6ed..3bce9b1 100755
--- a/fff
+++ b/fff
@@ -61,10 +61,10 @@ open() {
xbm|xif|xla|xlam|xls|xlsb|xlsm|xlsx|xlt|xltm|xltx|xm|xmind|xpi|xpm|\
xwd|xz|z|zip|zipx)
[[ "$OSTYPE" == darwin* ]] && oc="open"
- nohup "${oc:-xdg-open}" "$1" &>/dev/null & disown
+ nohup "${FFF_OPENER:-${oc:-xdg-open}}" "$1" &>/dev/null & disown
;;
- *) "${EDITOR:-vi}" "$1"; printf '\e[?25l' ;;
+ *) "${FFF_EDITOR:-${EDITOR:-vi}}" "$1"; printf '\e[?25l' ;;
esac
}
}
diff --git a/fff.1 b/fff.1
index 1594430..fe86c26 100644
--- a/fff.1
+++ b/fff.1
@@ -102,7 +102,10 @@ export FFF_COL2=7
export FFF_COL3=6
.TP
\fBText Editor\fR
-export EDITOR="cmd"
+export FFF_EDITOR="vim" # alternative: export EDITOR="vim"
+.TP
+\fBFile Opener\fR
+export FFF_OPENER="xdg-open"
.TP
\fBFavourites (keys 1-9) (dir or file)\fR