Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ autocompletion replacing the subsequent word

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!

like image 367
claudehenry Avatar asked Feb 16 '16 05:02

claudehenry


People also ask

How do you replace a word with another word in IntelliJ?

Press Ctrl+H or choose Edit | Find | Replace from the main menu. The search and replace pane appears on top of the active editor. If necessary, specify the search and replace options. In the search field, start typing the search string.

Why Autocomplete is not working in IntelliJ?

I have tried the following according to this thread (Intellij IDEA CE 12 Android XML Code Completion not working): Go to File->Power Save Mode and disable it - it is off. Go to Preferences->Editor->Code Completion and check Autopopup code completion - this has been checked. Go to File->Invalidate Caches and restart.

How do I turn off auto suggestions in IntelliJ?

Start typing. By default, IntelliJ IDEA displays the code completion popup automatically as you type. If automatic completion is disabled, press Ctrl+Shift+Space or choose Code | Code Completion | Type-Matching from the main menu.

How do I enable code completion in IntelliJ IDEA?

By default, IntelliJ IDEA displays the code completion popup automatically as you type. If automatic completion is disabled, press Ctrl+Space or choose Code | Code Completion | Basic from the main menu. If necessary, press Ctrl+Space for the second time (or press Ctrl+Alt+Space ).

What is postfix completion in IntelliJ?

Postfix code completion is similar to live templates which allow you to create custom constructs to be used anywhere inside your code. IntelliJ IDEA automatically completes names and values of tags and attributes in many file types: HTML/XHTML, including completion for CSS classes and for HTML tags inside JSX.

How do I complete a list in IntelliJ?

Start typing. By default, IntelliJ IDEA displays the code completion popup automatically as you type. If automatic completion is disabled, press Ctrl+Shift+Space or choose Code | Code Completion | Type-Matching from the main menu. If necessary, press Ctrl+Shift+Space once again. This lets you complete: Collections, lists and arrays.

How do I enable type matching in IntelliJ?

Start typing. By default, IntelliJ IDEA displays the code completion popup automatically as you type. If automatic completion is disabled, press Ctrl+Shift+Space or choose Code | Code Completion | Type-Matching from the main menu.


1 Answers

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.

like image 168
yole Avatar answered Oct 13 '22 12:10

yole