summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2019-12-27 18:15:16 +0100
committertoonn <toonn@toonn.io>2019-12-27 18:15:16 +0100
commit5581c896a97ee7740dd1b142a053fc24681c1f72 (patch)
tree99188480bf5f37d11940afb947780506c28b5342 /ranger
parentda29ef8d6ae6848a8c0c0df277a2da0de337b532 (diff)
downloadranger-5581c896a97ee7740dd1b142a053fc24681c1f72.tar.gz
Improve filter_stack documentation
Add an entry about `filter_stack` to the man page, documenting the various
subcommands and available filters. Add documentation about the new
mappings.

Add functionality to the `rotate` subcommand so you can pass the
argument as a `quantifier`, i.e., a numeric prefix. Change the `.r`
mapping to rely on this behavior accordingly, reducing the amount of
unnecessary return pressing.
Diffstat (limited to 'ranger')
-rwxr-xr-xranger/config/commands.py2
-rw-r--r--ranger/config/rc.conf11
2 files changed, 8 insertions, 5 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index cb6fa132..cbff8098 100755
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -1690,7 +1690,7 @@ class filter_stack(Command):
         elif subcommand == "clear":
             self.fm.thisdir.filter_stack = []
         elif subcommand == "rotate":
-            rotate_by = int(self.arg(2) or 1)
+            rotate_by = int(self.arg(2) or self.quantifier or 1)
             self.fm.thisdir.filter_stack = (
                 self.fm.thisdir.filter_stack[-rotate_by:]
                 + self.fm.thisdir.filter_stack[:-rotate_by]
diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf
index 666a99cf..e62f4ecd 100644
--- a/ranger/config/rc.conf
+++ b/ranger/config/rc.conf
@@ -593,16 +593,19 @@ map zf    console filter%space
 copymap zf zz
 
 # Filter stack
-map .n console filter_stack add name%space
-map .m console filter_stack add mime%space
-map .# console filter_stack add hash%space
 map .d filter_stack add type d
 map .f filter_stack add type f
 map .l filter_stack add type l
+map .m console filter_stack add mime%space
+map .n console filter_stack add name%space
+map .# console filter_stack add hash%space
+# alternatively .: and .;?
+map ." filter_stack add duplicate
+map .' filter_stack add unique
 map .| filter_stack add or
 map .& filter_stack add and
 map .! filter_stack add not
-map .r console filter_stack rotate
+map .r filter_stack rotate
 map .c filter_stack clear
 map .* filter_stack decompose
 map .p filter_stack pop