diff options
author | Dylan Araps <dylan.araps@gmail.com> | 2018-10-23 17:45:09 +1100 |
---|---|---|
committer | Dylan Araps <dylan.araps@gmail.com> | 2018-10-23 17:45:09 +1100 |
commit | f5e2c55dbcead2b583a8dcf1a5d2a55a5c383c71 (patch) | |
tree | 690215c21ff7d30fecf45cf3e01e1f400069c2f7 | |
parent | 0c43aafb04c599abadec085721abe1c835f8de5a (diff) |
allow user to set editor and opener
-rw-r--r-- | README.md | 5 | ||||
-rwxr-xr-x | fff | 4 | ||||
-rw-r--r-- | fff.1 | 5 |
3 files changed, 10 insertions, 4 deletions
@@ -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 @@ -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 } } @@ -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 |