Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions fff
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/usr/bin/env bash

CURRENT_EDITOR=nano
#CURRENT_EDITOR=micro
#CURRENT_EDITOR=vi

get_os() {
# Figure out the current operating system to set some specific variables.
# '$OSTYPE' typically stores the name of the OS kernel.
Expand Down Expand Up @@ -1022,7 +1026,7 @@ open() {
text/*|*x-empty*|*json*)
clear_screen
reset_terminal
"${VISUAL:-${EDITOR:-vi}}" "$1"
"${VISUAL:-${EDITOR:-"${CURRENT_EDITOR}"}}" "$1"
setup_terminal
redraw
;;
Expand Down Expand Up @@ -1994,7 +1998,8 @@ main() {

# Create the trash and cache directory if they don't exist.
mkdir -p "${XDG_CACHE_HOME:=${HOME}/.cache}/fff" \
"${FFF_TRASH:=${XDG_DATA_HOME:=${HOME}/.local/share}/fff/trash}"
"${FFF_TRASH:=${XDG_DATA_HOME:=${HOME}/.local/share}/fff/trash}" \
"${XDG_CACHE_HOME:=${HOME}/.cache}/fff/history"

# 'nocaseglob': Glob case insensitively (Used for case insensitive search).
# 'nullglob': Don't expand non-matching globs to themselves.
Expand Down