diff options
-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: |