summary refs log tree commit diff stats
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
parent34c0d954f221e3541c195027851e471204993177 (diff)
downloadranger-032bd50b6d3f6826db1f035a28fdf0e0c1bac6e0.tar.gz
ext.rifle: Added a default editor
-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:
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205