summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-03-21 02:23:24 +0100
committerhut <hut@lavabit.com>2012-03-21 02:23:24 +0100
commit032bd50b6d3f6826db1f035a28fdf0e0c1bac6e0 (patch)
tree2c8e507e55e66fabf47b5f7cab9a62cb2f88d757 /ranger
parent34c0d954f221e3541c195027851e471204993177 (diff)
downloadranger-032bd50b6d3f6826db1f035a28fdf0e0c1bac6e0.tar.gz
ext.rifle: Added a default editor
Diffstat (limited to 'ranger')
-rwxr-xr-xranger/ext/rifle.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/ranger/ext/rifle.py b/ranger/ext/rifle.py
index ba10427e..1a7da017 100755
--- a/ranger/ext/rifle.py
+++ b/ranger/ext/rifle.py
@@ -26,6 +26,9 @@ from ranger.ext.spawn import spawn
 from ranger.ext.get_executables import get_executables
 import time
 
+DEFAULT_PAGER = 'less'
+DEFAULT_EDITOR = 'nano'
+
 def _is_terminal():
 	# Check if stdin (file descriptor 0), stdout (fd 1) and
 	# stderr (fd 2) are connected to a terminal
@@ -256,7 +259,9 @@ class Rifle(object):
 				self.hook_logger("Method number %d is undefined." % way)
 		else:
 			if 'PAGER' not in os.environ:
-				os.environ['PAGER'] = 'less'
+				os.environ['PAGER'] = DEFAULT_PAGER
+			if 'EDITOR' not in os.environ:
+				os.environ['EDITOR'] = DEFAULT_EDITOR
 			command = self.hook_command_postprocessing(command)
 			self.hook_before_executing(command, self._mimetype, self._app_flags)
 			try: