gpt4 book ai didi

scala - 在 Scala Repl 中暂时禁用制表符补全

转载 作者:行者123 更新时间:2023-12-01 23:59:44 26 4
gpt4 key购买 nike

我偶尔会使用带有硬制表符而不是空格的代码。是否有任何 repl 命令指示解释器至少暂时将制表符作为普通空白处理 - 沿着 :paste 行?

最佳答案

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

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

关于scala - 在 Scala Repl 中暂时禁用制表符补全,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22097896/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com