summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/config/rc.conf2
-rw-r--r--ranger/container/directory.py1
2 files changed, 3 insertions, 0 deletions
diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf
index 687d591e..59237a59 100644
--- a/ranger/config/rc.conf
+++ b/ranger/config/rc.conf
@@ -399,6 +399,7 @@ map om chain set sort=mtime;     set sort_reverse=False
 map oc chain set sort=ctime;     set sort_reverse=False
 map oa chain set sort=atime;     set sort_reverse=False
 map ot chain set sort=type;      set sort_reverse=False
+map oe chain set sort=extension; set sort_reverse=False
 
 map oS chain set sort=size;      set sort_reverse=True
 map oB chain set sort=basename;  set sort_reverse=True
@@ -407,6 +408,7 @@ map oM chain set sort=mtime;     set sort_reverse=True
 map oC chain set sort=ctime;     set sort_reverse=True
 map oA chain set sort=atime;     set sort_reverse=True
 map oT chain set sort=type;      set sort_reverse=True
+map oE chain set sort=extension; set sort_reverse=True
 
 map dc get_cumulative_size
 
diff --git a/ranger/container/directory.py b/ranger/container/directory.py
index 3a609cf6..63502ce9 100644
--- a/ranger/container/directory.py
+++ b/ranger/container/directory.py
@@ -110,6 +110,7 @@ class Directory(FileSystemObject, Accumulator, Loadable):
         'atime': lambda path: -(path.stat and path.stat.st_atime or 1),
         'random': lambda path: random.random(),
         'type': lambda path: path.mimetype or '',
+        'extension': lambda path: path.extension or '',
     }
 
     def __init__(self, path, **kw):