about summary refs log tree commit diff stats
path: root/ranger/defaults/keys.py
diff options
context:
space:
mode:
Diffstat (limited to 'ranger/defaults/keys.py')
-rw-r--r--ranger/defaults/keys.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/ranger/defaults/keys.py b/ranger/defaults/keys.py
index 5586a4a4..2a775ab9 100644
--- a/ranger/defaults/keys.py
+++ b/ranger/defaults/keys.py
@@ -137,6 +137,8 @@ def initialize_commands(command_list):
 	bind('h', KEY_LEFT, KEY_BACKSPACE, DEL, lambda fm, n: \
 			fm.move_left(n or 1))
 
+	bind('P', lambda fm, n: fm.ui.open_pman())
+
 	command_list.rebuild_paths()
 
 
@@ -182,3 +184,23 @@ def initialize_console_commands(command_list):
 		bind(i, type_key(i))
 
 	command_list.rebuild_paths()
+
+def initialize_process_manager_commands(command_list):
+	"""Initialize the commands for the process manager widget"""
+
+	from ranger.gui.widgets.process_manager import KeyWrapper as wdg
+
+	def bind(*args):
+		command_list.bind(args[-1], *args[:-1])
+
+	def do_fm(method, *args, **kw):
+		return lambda con: getattr(con.fm, method)(*args, **kw)
+
+	bind('j', KEY_DOWN, wdg.move(relative=1))
+	bind('k', KEY_UP, wdg.move(relative=-1))
+	bind('gg', wdg.move(absolute=0))
+	bind('G', wdg.move(absolute=-1))
+
+	bind('P', ESC, ctrl('d'), lambda wdg, n: wdg.fm.ui.close_pman())
+
+	command_list.rebuild_paths()