From 7821555cdbd28cd710ce94cde8bfd90e5cf1a13a Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 19 Apr 2010 21:45:25 +0200 Subject: Turn keycomb ".term" into command ":terminal" --- ranger/defaults/commands.py | 10 ++++++++++ ranger/defaults/keys.py | 1 - ranger/help/console.py | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ranger/defaults/commands.py b/ranger/defaults/commands.py index 241e66df..6088e8ff 100644 --- a/ranger/defaults/commands.py +++ b/ranger/defaults/commands.py @@ -221,6 +221,16 @@ class quit_now(Command): self.fm.exit() +class terminal(Command): + """ + :terminal + + Spawns an "x-terminal-emulator" starting in the current directory. + """ + def execute(self): + self.fm.run('x-terminal-emulator', flags='d') + + class delete(Command): """ :delete diff --git a/ranger/defaults/keys.py b/ranger/defaults/keys.py index 0a9cb6a3..8c4c3535 100644 --- a/ranger/defaults/keys.py +++ b/ranger/defaults/keys.py @@ -167,7 +167,6 @@ map('p', fm.hint('press *p* once again to confirm pasting' \ # ---------------------------------------------------- run programs map('S', fm.execute_command(os.environ['SHELL'])) map('E', fm.edit_file()) -map('.term', fm.execute_command('x-terminal-emulator', flags='d')) map('du', fm.execute_command('du --max-depth=1 -h | less')) # -------------------------------------------------- toggle options diff --git a/ranger/help/console.py b/ranger/help/console.py index 76ce9f59..c62d0244 100644 --- a/ranger/help/console.py +++ b/ranger/help/console.py @@ -103,6 +103,9 @@ it conflicts with ":cd". :rename Changes the name of the currently highlighted file to +:terminal + Spawns "x-terminal-emulator" starting in the current directory. + :touch Creates a file with the name -- cgit 1.4.1-2-gfad0