diff options
author | hut <hut@lavabit.com> | 2010-04-27 22:15:41 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-04-27 22:15:41 +0200 |
commit | 1e47d0d9086595633218824b0efb30eb1a38c3a7 (patch) | |
tree | 01665be5369e6e4f862fbf5a15d3c9b3b49aa487 | |
parent | 4db79381d4874318c76c605cf990c630c9d70115 (diff) | |
download | ranger-1e47d0d9086595633218824b0efb30eb1a38c3a7.tar.gz |
widgets.console: added macros %t and %c in the OpenConsole
-rw-r--r-- | ranger/gui/widgets/console.py | 7 | ||||
-rw-r--r-- | ranger/help/console.py | 10 |
2 files changed, 15 insertions, 2 deletions
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py index 59a779de..f06b911b 100644 --- a/ranger/gui/widgets/console.py +++ b/ranger/gui/widgets/console.py @@ -462,6 +462,13 @@ class OpenConsole(ConsoleWithTab): dct['s'] = ' '.join(shell_quote(fl.basename) \ for fl in self.fm.env.get_selection()) + dct['c'] = ' '.join(shell_quote(fl.path) + for fl in self.fm.env.copy) + + dct['t'] = ' '.join(shell_quote(fl.basename) + for fl in self.fm.env.cwd.files + if fl.realpath in self.fm.tags) + return _CustomTemplate(command).safe_substitute(dct) def _parse(self): diff --git a/ranger/help/console.py b/ranger/help/console.py index 04372f38..fa02eae1 100644 --- a/ranger/help/console.py +++ b/ranger/help/console.py @@ -163,8 +163,14 @@ Open this console by pressing "!" or "s" The Open Console allows you to execute shell commands: !vim * will run vim and open all files in the directory. -%f will be replaced with the basename of the highlighted file -%s will be selected with all files in the selection +Like in similar filemanagers there are some macros. Use them in +commands and they will be replaced with a list of files. + %f the highlighted file + %s the selected files + %t all tagged files in the current directory + %c all currently copied/cut files +Example: Yank a file (type yy), move to a different file and use: +!p!diff %c %f There is a special syntax for more control: |