diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/plugin_avfs.py | 33 | ||||
-rw-r--r-- | examples/rc_emacs.conf | 5 |
2 files changed, 37 insertions, 1 deletions
diff --git a/examples/plugin_avfs.py b/examples/plugin_avfs.py new file mode 100644 index 00000000..07968a03 --- /dev/null +++ b/examples/plugin_avfs.py @@ -0,0 +1,33 @@ +# Tested with ranger 1.9.1 +# +# A very simple and possibly buggy support for AVFS +# (http://avf.sourceforge.net/), that allows ranger to handle +# archives. +# +# Run `:avfs' to browse the selected archive. + +from __future__ import (absolute_import, division, print_function) + +import os +import os.path + +from ranger.api.commands import Command + + +class avfs(Command): # pylint: disable=invalid-name + avfs_root = os.path.join(os.environ["HOME"], ".avfs") + avfs_suffix = "#" + + def execute(self): + if os.path.isdir(self.avfs_root): + archive_directory = "".join([ + self.avfs_root, + self.fm.thisfile.path, + self.avfs_suffix, + ]) + if os.path.isdir(archive_directory): + self.fm.cd(archive_directory) + else: + self.fm.notify("This file cannot be handled by avfs.", bad=True) + else: + self.fm.notify("Install `avfs' and run `mountavfs' first.", bad=True) diff --git a/examples/rc_emacs.conf b/examples/rc_emacs.conf index 26074a42..0462282e 100644 --- a/examples/rc_emacs.conf +++ b/examples/rc_emacs.conf @@ -122,6 +122,9 @@ set mouse_enabled true set display_size_in_main_column true set display_size_in_status_bar true +# Display the free disk space in the status bar? +set display_free_space_in_status_bar true + # Display files tags in all columns or only in main column? set display_tags_in_all_columns true @@ -129,7 +132,7 @@ set display_tags_in_all_columns true set update_title false # Set the title to "ranger" in the tmux program? -set update_tmux_title false +set update_tmux_title true # Shorten the title if it gets long? The number defines how many # directories are displayed at once, 0 turns off this feature. |