暂时禁用Scala Repl中的选项卡完成

时间:2014-02-28 14:29:51

标签: scala read-eval-print-loop

我偶尔使用具有硬标签而非空格的代码。是否有任何repl命令指示解释器至少暂时将标签处理为正常的空格 - 沿着以下方式处理:粘贴?

1 个答案:

答案 0 :(得分:3)

确实:paste听起来不错,但是如果你真的想要覆盖键绑定,你可以像这样提供自己的设置文件:

scala -Djline.keybindings=myfile

我从默认scala jar中查找的文件格式如下:

来自scala/tools/jline/keybindings.properties中的文件jline.jar

# Keybinding mapping for JLine. The format is:
#    [key code]=[logical operation]

# CTRL-A: move to the beginning of the line
1=MOVE_TO_BEG

# CTRL-B: move to the previous character
2=PREV_CHAR

# CTRL-D: close out the input stream
4=EXIT

# CTRL-E: move the cursor to the end of the line
5=MOVE_TO_END

# CTRL-F: move to the next character
6=NEXT_CHAR

# CTRL-G: abort
7=ABORT

# BACKSPACE, CTRL-H: delete the previous character
# 8 is the ASCII code for backspace and therefor
# deleting the previous character
8=DELETE_PREV_CHAR

# TAB, CTRL-I: signal that console completion should be attempted
9=COMPLETE

将命令匹配选项9替换为空字符串。

http://www.scala-sbt.org/release/docs/Howto/interactive.html#change-keybindings