IntelliJ 自动完成替换后续单词 [英] IntelliJ autocompletion replacing the subsequent word

查看:21
本文介绍了IntelliJ 自动完成替换后续单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 IntelliJ 已经有一段时间了,但总有一些事情困扰着我.它与自动完成功能有关.这个gif应该足以说明.

本质上,当在另一个单词旁边键入一个单词时(即中间没有空格),无论两个单词或上下文,无论是关键字还是变量,自动完成功能都会用您完成的单词替换下一个单词.我/很惊讶 IntelliJ 没有设置(至少我不知道)考虑到 Eclipse 确实......

提前致谢!

I've been using IntelliJ for a while now, but there's always been something that bothers me. Its to do with the autocomplete feature. This gif should be enough to illustrate.

In essence, when typing a word next to another one (that is with no space in between) regardless of the two words or the context, be it keywords or variables, the autocomplete will replace the next word by the one you complete with. I/m surprised that IntelliJ doesn't have a setting for that (at least not that I'm aware of) considering Eclipse does...

Thanks in advance!

推荐答案

此行为取决于您用于从完成列表中选择项目的键.如果按 Enter,所选项目将插入代码中以下标识符之前.如果按 Tab,所选项目将替换光标后的标识符.

This behavior depends on the key that you use to select the item from the completion list. If you press Enter, the selected item is inserted in the code before the following identifier. If you press Tab, the selected item replaces the identifier following the cursor.

如果您愿意,可以通过在设置 | 下为选择查找项目"和选择查找项目替换"重新分配键盘快捷键来更改行为.键映射.

If you prefer, you can change the behavior by reassigning keyboard shortcuts for "Choose Lookup Item" and "Choose Lookup Item Replace" under Settings | Keymap.

这篇关于IntelliJ 自动完成替换后续单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆