bang: repeat your last command 重复你的最后指令


This plugin was requested in Here, you the reader could also publish your demands in the 求插件 category, see if there are 有缘人 to work on it!

Summary 概述

这个插件添加了一个简单的拦截器,用于记录你使用的所有指令(包含参数),然后你可以键入 !! 重复最后指令,就像 bash 或其他 Linux 贝壳。

This plugin adds a simple interceptor to capture all commands (with arguments) that you using, and then you could type !! to repeat the last command just like bash or other Linux shells.

Features 功能

  • Capture and repeat any commands 捕获和重复任何指令
  • Support index and / or string searching 支持目录和/或字串搜索
  • Print-only mode (do not execute, for copy-n-paste or fixing commands previous) 仅打印模式(不会运行,用于复制粘贴或修复前次指令)

Example 示例

  • !n - repeat the nth command 重复第 n 条指令
  • !-n - repeat the nth command reversely 重复倒数第 n 条指令
  • !! - repeat the last command, shorthand for !-1 重复最后指令,!-1 的捷径
  • !str - repeat the last command that starts with str 重复最后一条以 str 开头的指令
  • !?str - repeat the last command that contains str 重复最后一条包含 str 的指令

Suffixes 后缀

  • :p - print the command instead of executing it 打印指令但不运行它
    For example: !!:p then the bot would print the last command that you have entered.
    示例:!!:p 然后机器人会打印最后的指令你运行的。
4 个赞

很多shell也支持:s:n后缀,但实现起来并不容易,所以我没有把它们包含在当前版本中。 但我认为这些将成为 bang 插件提供的功能会很棒。

There are also :s or :n suffixes supported in many shells, but it is not easy to be implemented, so I have not included them in the current version. But I think these would be great to be the features that the bang plugin provides.

2 个赞

《Linux 贝壳》

2 个赞


1 个赞