IntelliJ,在用快捷方式注释一行后禁用光标移动? [英] IntelliJ, disable cursor moving after commenting a line with a shortcut?
本文介绍了IntelliJ,在用快捷方式注释一行后禁用光标移动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我注释掉了或者在IntelliJ 14中用 Ctrl + /注释了一行,则光标会向下移动一行.如何禁用它?
If I comment out or in a line with Ctrl+/ in IntelliJ 14 the cursor moves a line down. How can I disable that?
推荐答案
您不能禁用它,但是可以定义一个宏.
You cannot disable that, however you can define a macro.
- 以
Edit开头|宏|开始宏录制
- 按 Ctrl + /注释掉当前行
- 按上键将插入符号再次移至该行
- 以
结尾|编辑|宏|停止宏录制
- Start with
Edit | Macros | Start Macro Recording
- Press Ctrl+/ to comment out current line
- Press Up to move caret to that line again
- End with
Edit | Macros | Stop Macro Recording
插入符将恢复到与以前相同的逻辑位置,正如预期的那样.
The caret will return to the same logical position as before, just as expected.
您可以将该宏分配给您喜欢的任何键盘快捷键: Settings |按键图|宏
You can assign that macro to any keyboard shortcut you like: Settings | Keymap | Macros
这篇关于IntelliJ,在用快捷方式注释一行后禁用光标移动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文