重复上一个sbt命令?

时间:2012-10-05 17:57:21

标签: scala intellij-idea sbt

是否有短sbt命令或键盘快捷键重新调用最后发出的命令?我发现自己必须反复执行这个问题:

> test-only my.long.package.etc.class.name

复制+粘贴有点烦人。我在IntelliJ IDEA中使用sbt控制台,因此向上滚动浏览历史记录不起作用。

2 个答案:

答案 0 :(得分:12)

你想要!!。要查看sbt的帮助,请在提示符下键入help

> help

  help                         Displays this help message or prints detailed help on requested commands (run 'help <command>').
  about                        Displays basic information about sbt and the build.
  reload                       (Re)loads the project in the current directory
  settings                     Lists the settings defined for the current project.
  tasks                        Lists the tasks defined for the current project.
  projects                     Lists the names of available projects or temporarily adds/removes extra builds to the session.
  project                      Displays the current project or changes to the provided `project`.
  set                          Evaluates a Setting and applies it to the current project.
  session                      Manipulates session settings.  For details, run 'help session'.
  inspect                      Prints the value for 'key', the defining scope, delegates, related definitions, and dependencies.
  ; <command> (; <command>)*   Runs the provided semicolon-separated commands.
  ~ <command>                  Executes the specified command whenever source files change.
  last                         Displays output from a previous command or the output from a specific task.
  last-grep                    Shows lines from the last output for 'key' that match 'pattern'.
  exit                         Terminates the build.
  show <key>                   Displays the result of evaluating the setting or task associated with 'key'.

More command help available using 'help <command>' for:
  !, -, <, alias, append, apply, eval, iflast, reboot, shell

然后获取!的帮助:

> !
History commands:
   !!    Execute the last command again
   !:    Show all previous commands
   !:n    Show the last n commands
   !n    Execute the command with index n, as shown by the !: command
   !-n    Execute the nth command before this one
   !string    Execute the most recent command starting with 'string'
   !?string    Execute the most recent command containing 'string'

答案 1 :(得分:2)

升级到IDEA的sbt插件的最新版本1.4.0,因为它支持箭头键历史记录。