summary refs log tree commit diff stats
path: root/doc/examples/plugin_new_sorting_method.py
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-03-09 18:48:02 +0100
committerhut <hut@lavabit.com>2013-03-09 18:48:02 +0100
commitd2c7d024290ee95afa418975c728ad64172dcfec (patch)
treeeea0659eab7bb0c7b9cc2026468c840d7f22a5c9 /doc/examples/plugin_new_sorting_method.py
parent62af277734f05f27f20467393c9d997012ddd2b4 (diff)
downloadranger-d2c7d024290ee95afa418975c728ad64172dcfec.tar.gz
move examples to doc/examples
Diffstat (limited to 'doc/examples/plugin_new_sorting_method.py')
-rw-r--r--doc/examples/plugin_new_sorting_method.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/examples/plugin_new_sorting_method.py b/doc/examples/plugin_new_sorting_method.py
new file mode 100644
index 00000000..02abbc47
--- /dev/null
+++ b/doc/examples/plugin_new_sorting_method.py
@@ -0,0 +1,9 @@
+# Compatible with ranger 1.6.*
+#
+# This plugin adds the sorting algorithm called 'random'.  To enable it, type
+# ":set sort=random" or create a key binding with ":map oz set sort=random"
+
+from ranger.fsobject.directory import Directory
+from random import random
+Directory.sort_dict['random'] = lambda path: random()
+