diff options
author | hut <hut@lepus.uberspace.de> | 2015-04-19 02:06:01 +0200 |
---|---|---|
committer | hut <hut@lepus.uberspace.de> | 2015-04-19 02:06:09 +0200 |
commit | 1bcb5c9c4b6396f935cfd46e6ad38f7a295fab43 (patch) | |
tree | 77b7accb24177921d039cc102ad28d690214d14e | |
parent | 842e20e3ab54d699969eb87e5474e2d33c844d9f (diff) | |
download | ranger-1bcb5c9c4b6396f935cfd46e6ad38f7a295fab43.tar.gz |
added example plugin that adds a linemode
-rw-r--r-- | examples/plugin_linemode.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/plugin_linemode.py b/examples/plugin_linemode.py new file mode 100644 index 00000000..e4513f5d --- /dev/null +++ b/examples/plugin_linemode.py @@ -0,0 +1,16 @@ +# Compatible since ranger 1.7.0 +# +# This sample plugin adds a new linemode displaying the filename in rot13. +# Load this plugin by copying it to ~/.config/ranger/plugins/ and activate +# the linemode by typing ":linemode rot13" in ranger. Type Mf to restore +# the default linemode. + +import codecs +import ranger.api +from ranger.core.linemode import LinemodeBase + +@ranger.api.register_linemode +class MyLinemode(LinemodeBase): + name = "rot13" + def filetitle(self, file, metadata): + return codecs.encode(file.basename, "rot_13") |