From ddce7b7c81b711c58f2466bc0f6df11e2e134e38 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 25 Feb 2013 05:21:42 +0100 Subject: config/commands: replace commands with aliases to :scout alias filter scout -prt alias find scout -aet alias mark scout -mr alias unmark scout -Mr alias search scout -r alias search_inc scout -rt alias travel scout -aefiklst --- ranger/config/commands.py | 172 ---------------------------------------------- ranger/config/rc.conf | 8 +++ 2 files changed, 8 insertions(+), 172 deletions(-) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index fa79d487..84b2aada 100644 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -179,16 +179,6 @@ class chain(Command): self.fm.execute_console(command) -class search(Command): - def execute(self): - self.fm.search_file(self.rest(1), regexp=True) - - -class search_inc(Command): - def quick(self): - self.fm.search_file(self.rest(1), regexp=True, offset=0) - - class shell(Command): escape_macros_for_shell = True @@ -327,60 +317,6 @@ class open_with(Command): return all(x in '0123456789' for x in arg) -class find(Command): - """:find - - The find command will attempt to find a partial, case insensitive - match in the filenames of the current directory and execute the - file automatically. - """ - - count = 0 - tab = Command._tab_directory_content - - def execute(self): - if self.quick(): - if self.rest(1) == '..': - self.fm.move(left=1) - else: - self.fm.move(right=1) - self.fm.block_input(0.5) - else: - self.fm.cd(self.rest(1)) - - def quick(self): - self.count = 0 - cwd = self.fm.thisdir - arg = self.rest(1) - if not arg: - return False - - if arg == '.': - return False - if arg == '..': - return True - - deq = deque(cwd.files) - deq.rotate(-cwd.pointer) - i = 0 - case_insensitive = arg.lower() == arg - for fsobj in deq: - if case_insensitive: - filename = fsobj.basename_lower - else: - filename = fsobj.basename - if arg in filename: - self.count += 1 - if self.count == 1: - cwd.move(to=(cwd.pointer + i) % len(cwd.files)) - self.fm.thisfile = cwd.pointed_obj - if self.count > 1: - return False - i += 1 - - return self.count == 1 - - class set_(Command): """:set