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

查看:183
本文介绍了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.

如果您愿意,可以通过为选择查找项目重新分配键盘快捷键来更改行为, 设置下的选择查找项目替换 Keymap。

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天全站免登陆