summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-03-18 21:31:59 +0100
committerhut <hut@lavabit.com>2012-03-18 21:31:59 +0100
commit0e905425ac000641430c361bb37ef4a18183e56f (patch)
tree7d62e6b823890b1f8040b560abd1c9b99167452d
parent5ca9ab8ca0bdc772124b445341f17c6ca2066a8f (diff)
downloadranger-0e905425ac000641430c361bb37ef4a18183e56f.tar.gz
defaults/rifle.conf: improved, reordered
-rw-r--r--ranger/defaults/rifle.conf65
1 files changed, 35 insertions, 30 deletions
diff --git a/ranger/defaults/rifle.conf b/ranger/defaults/rifle.conf
index ea5af67a..5851f447 100644
--- a/ranger/defaults/rifle.conf
+++ b/ranger/defaults/rifle.conf
@@ -7,6 +7,8 @@
 # Syntax:
 #   <condition1> , <condition2> , ... = command
 #
+# Prefixing a condition with a "!" will negate its result.
+#
 # The command can contain these environment variables:
 #   $1-$9 | The n-th selected file
 #   $@    | All selected files
@@ -31,15 +33,39 @@
 #   w | ask the user to press enter after the process has been executed
 
 #-------------------------------------------
+# Websites
+#-------------------------------------------
+ext x?html?, has surf,           X, flag f = surf -- "$@"
+ext x?html?, has vimprobable,    X, flag f = vimprobable -- "$@"
+ext x?html?, has vimprobable2,   X, flag f = vimprobable2 -- "$@"
+ext x?html?, has jumanji,        X, flag f = jumanji -- "$@"
+ext x?html?, has luakit,         X, flag f = luakit -- "$@"
+ext x?html?, has uzbl,           X, flag f = uzbl -- "$@"
+ext x?html?, has firefox,        X, flag f = firefox -- "$@"
+ext x?html?, has seamonkey,      X, flag f = seamonkey -- "$@"
+ext x?html?, has iceweasel,      X, flag f = iceweasel -- "$@"
+ext x?html?, has opera,          X, flag f = opera -- "$@"
+ext x?html?, has midori,         X, flag f = midori -- "$@"
+ext x?html?, has epiphany,       X, flag f = epiphany -- "$@"
+ext x?html?, has konqueror,      X, flag f = konqueror -- "$@"
+ext x?html?, has elinks,          terminal = elinks "$@"
+ext x?html?, has links2,          terminal = links2 -- "$@"
+ext x?html?, has links,           terminal = links -- "$@"
+ext x?html?, has lynx,            terminal = lynx -- "$@"
+ext x?html?, has w3m,             terminal = w3m -- "$@"
+
+#-------------------------------------------
 # Misc
 #-------------------------------------------
-mime ^text                = "$EDITOR" -- "$@"
-ext xml|csv|tex           = "$EDITOR" -- "$@"
-ext 1                     = man "$1"
-ext s[wmf]c, has zsnes, X = zsnes "$1"
-ext nes, has fceux, X     = fceux "$1"
-ext exe                   = wine "$1"
-name ^[mM]akefile$        = make
+# Define the "editor" for text files as first action
+mime ^text,      label editor = "$EDITOR" -- "$@"
+ext xml|csv|tex, label editor = "$EDITOR" -- "$@"
+
+ext 1                         = man "$1"
+ext s[wmf]c, has zsnes, X     = zsnes "$1"
+ext nes, has fceux, X         = fceux "$1"
+ext exe                       = wine "$1"
+name ^[mM]akefile$            = make
 
 #--------------------------------------------
 # Code
@@ -119,28 +145,6 @@ ext tar|gz, has tar = tar vvtf "$@"
 ext tar|gz, has tar = tar vvxf "$@"
 
 #-------------------------------------------
-# Websites
-#-------------------------------------------
-ext x?html?, has surf,           X, flag f = surf -- "$@"
-ext x?html?, has vimprobable,    X, flag f = vimprobable -- "$@"
-ext x?html?, has vimprobable2,   X, flag f = vimprobable2 -- "$@"
-ext x?html?, has jumanji,        X, flag f = jumanji -- "$@"
-ext x?html?, has luakit,         X, flag f = luakit -- "$@"
-ext x?html?, has uzbl,           X, flag f = uzbl -- "$@"
-ext x?html?, has firefox,        X, flag f = firefox -- "$@"
-ext x?html?, has seamonkey,      X, flag f = seamonkey -- "$@"
-ext x?html?, has iceweasel,      X, flag f = iceweasel -- "$@"
-ext x?html?, has opera,          X, flag f = opera -- "$@"
-ext x?html?, has midori,         X, flag f = midori -- "$@"
-ext x?html?, has epiphany,       X, flag f = epiphany -- "$@"
-ext x?html?, has konqueror,      X, flag f = konqueror -- "$@"
-ext x?html?, has elinks,          terminal = elinks "$@"
-ext x?html?, has links2,          terminal = links2 -- "$@"
-ext x?html?, has links,           terminal = links -- "$@"
-ext x?html?, has lynx,            terminal = lynx -- "$@"
-ext x?html?, has w3m,             terminal = w3m -- "$@"
-
-#-------------------------------------------
 # Misc
 #-------------------------------------------
 label wallpaper, mime ^image, X = feh --bg-scale "$1"
@@ -148,4 +152,5 @@ label wallpaper, mime ^image, X = feh --bg-tile "$1"
 label wallpaper, mime ^image, X = feh --bg-center "$1"
 label wallpaper, mime ^image, X = feh --bg-fill "$1"
 
-label editor = "$EDITOR" -- "$@"
+# Define the editor for non-text files as last action
+label editor, !mime ^text, !ext xml|csv|tex  = "$EDITOR" -- "$@"