在Scala Repl中暂时禁用选项卡自动补全

3

我偶尔会遇到使用制表符而不是空格的代码。是否有任何repl命令可以指示解释器将制表符作为正常空格进行临时处理 - 类似于:paste?

1个回答

3

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

scala -Djline.keybindings=myfile

我查阅默认的Scala jar包中的文件格式如下:
来自jline.jar中的文件scala/tools/jline/keybindings.properties:
# 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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接