summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2019-01-14 15:11:50 +0200
committerDylan Araps <dylan.araps@gmail.com>2019-01-14 15:11:50 +0200
commit58e6262be707868f77a01cf0d22bcef1e3b21606 (patch)
treee2cbf584544a1eee928f1046f19b906ec92bd9f1
parent4a2bf9406ecb94764dcc8f5ccec315e198186d3b (diff)
general: Added favourites/bookmarks.
-rw-r--r--README.md13
-rwxr-xr-xfff9
-rw-r--r--fff.113
3 files changed, 35 insertions, 0 deletions
diff --git a/README.md b/README.md
index 93e0b1a..c9963b6 100644
--- a/README.md
+++ b/README.md
@@ -95,6 +95,8 @@ d: mark trash (~/.cache/fff/trash/)
p: paste/move/delete
c: clear file selections
+[1-9]: favourites/bookmarks (see customization)
+
q: exit
```
@@ -133,6 +135,17 @@ export FFF_CD_FILE=~/.fff_d
# Default: '${XDG_CACHE_HOME}/fff/trash'
# If not using XDG, '${HOME}/.cache/fff/trash' is used.
export FFF_TRASH=~/.cache/fff/trash
+
+# Favourites (Bookmarks) (keys 1-9) (dir or file)
+export FFF_FAV1=~/projects
+export FFF_FAV2=~/.bashrc
+export FFF_FAV3=~/Pictures/Wallpapers/
+export FFF_FAV4=/usr/share
+export FFF_FAV5=/
+export FFF_FAV6=
+export FFF_FAV7=
+export FFF_FAV8=
+export FFF_FAV9=
```
## Why?
diff --git a/fff b/fff
index 761f045..47cf997 100755
--- a/fff
+++ b/fff
@@ -631,6 +631,15 @@ key() {
open "$previous_dir"
;;
+ # Directory favourites.
+ [1-9])
+ favourite="FFF_FAV${1}"
+ favourite="${!favourite}"
+
+ [[ $favourite ]] &&
+ open "$favourite"
+ ;;
+
# Quit and store current directory in a file for CD on exit.
q)
: "${FFF_CD_FILE:=${XDG_CACHE_HOME:=${HOME}/.cache}/fff/.fff_d}"
diff --git a/fff.1 b/fff.1
index 2171f73..722a1f7 100644
--- a/fff.1
+++ b/fff.1
@@ -46,6 +46,8 @@ d: mark trash (~/\.cache/fff/trash/)
p: paste/move/delete
c: clear file selections
+[1-9]: favourites/bookmarks (see customization)
+
q: exit
.
.fi
@@ -86,5 +88,16 @@ export FFF_CD_FILE=~/.fff_d
# Default: '${XDG_CACHE_HOME}/fff/trash'
# If not using XDG, '${HOME}/.cache/fff/trash' is used.
export FFF_TRASH=~/.cache/fff/trash
+
+# Favourites (Bookmarks) (keys 1-9) (dir or file)
+export FFF_FAV1=~/projects
+export FFF_FAV2=~/.bashrc
+export FFF_FAV3=~/Pictures/Wallpapers/
+export FFF_FAV4=/usr/share
+export FFF_FAV5=/
+export FFF_FAV6=
+export FFF_FAV7=
+export FFF_FAV8=
+export FFF_FAV9=
.
.fi