这是一个非常小的键绑定属性文件,包括您想要的^D
:
# CTRL-B: move to the previous character
2: PREV_CHAR
# CTRL-D: delete the previous character
4: DELETE_NEXT_CHAR
# CTRL-F: move to the next character
6: NEXT_CHAR
# 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
# CTRL-J, CTRL-M: newline
10: NEWLINE
# ENTER: newline
13: NEWLINE
# CTRL-N: scroll to the next element in the history buffer
14: NEXT_HISTORY
# CTRL-P: scroll to the previous element in the history buffer
16: PREV_HISTORY
# CTRL-V: paste the contents of the clipboard (useful for Windows terminal)
22: PASTE
# DELETE, CTRL-?: delete the previous character
# 127 is the ASCII code for delete
127: DELETE_PREV_CHAR
把它放在一个文件中,然后像这样调用 scala:
scala -Djline.keybindings=/path/to/keybindings.properties
或者通过它JAVA_OPTS
。您必须在 Internet 上查找存在哪些键绑定,并尝试:keybindings
从 Scala 中查看默认值是什么(但它不会反映您的实际键绑定)。