I use eclipse and when I do code completion, I'd really like to keep my hands on the home row and push "CTRL-N" for the next code completion suggestion, and "CTRL-P" for the previous one. I'm not seeing anything that looks like what I need in the Preferences > General > Keys menu. Anyone have any ideas?
As said in the comment above:
I figured out from that that the bindings I wanted were "Line Up" and "Line Down".
Related
In Eclipse, when i select part of a text and press any key, the whole selection is replaced.
I would like to know how to make it, instead of replacing the text, add the key pressed to both ends of the selection, as it happens on visual studio code.
Example:
System.out.println(HelloWorld);
Select Hello World
System.out.println(HelloWorld);
Then press the " button. The code will turn to
System.out.println(");
Can i config the IDE so it will instead change it to
System.out.println("HelloWorld");
There is a already answered question like this one, but considering that one as 7 years and a lot of version old, and also considering that the answer on that one is kind of a work around, i would like to know if there's any new plugin or configuration that make it work better
From what I gather, you are wanting to do something like this?
Go to Java > Editor > Templates and add a new template, e. g. called quote, as follows:
"${word_selection}"${cursor}
Then, in the editor, write a text you want to quote, select it, press Ctrl+Space, type quote and hit Return. The highlighted text should be quoted now.
If you don't get template proposals when pressing Ctrl+Space, make sure you have them checked in Java > Editor > Content Assist > Advanced.
Just tried it and it works for me!
You can use this method for other things, like (${word_selection})${cursor} for parenthesis or '${word_selection}'${cursor} for single quote.
Hey there basically I'm seeing unexpected auto completion by intellij. I have tried multiple way to get it to work the way I expected it to and can't.
https://www.webmshare.com/play/yAPxo
The first line is what happens when you press tab to auto complete something and the following is when you click it in the menu.
I was wondering if it is possible to change the behavior so when I press it TAB it follows the behavior of the second line.
Thanks.
I came from work, I am glad it worked for you, so I wanted to add it as an answer.
Enter is the key for what you click in the menu to autoComplete. Tab replaces the remaining part, whereas enter just adds the completion into where the caret is. You should be able to change keys for those actions. To change those keys:
Open preferences in Intellij and go to Keymap
Change Choose Lookup Item with whichever key you want to use (it is tab key in your case I presume)
By default, pressing the Comment out shortcut keys Ctrl + /, has behavior like this:
Notice that the // get added at the left-most position of the row.
Is there a way to set it so that the // appear at the same level of indention as the code that is being commented out?
e.g.
Perhaps a Python habit, but I find it much easier to parse when everything is at the same indention level.
Is there a way to change where the slashes show up?
Yes, it's possible.
go to this link for detailed info
First go to Preferences, then
On the left side of the box, expand the Java option, then expand Code
Style and finally click Formatter
You'll land on the Java-Profile page:
The other, temporary way is via CTRL+SHIFT+F shortcut ( Eclipse: Change the block comment style of ctrl+shift+/ ) . So you'd highlight those comments, and press the combo.
I would then also use a shortcut for CTRL+SHIFT+F , like ALT+F5 (press CTRL+3 , 'keys' to get the preferences page.
I had checked out a Project from Our CVS. When I tried to build it in Eclipse by adding some jars, it showed a lot of errors under the Problems View in Eclipse.
It displayed nearly 12,000 errors, but I could see only the first 100 of those 12,000 errors.
Could anybody please explain how I can see the next 100 errors?
And I don't know why, but after I check out from CVS I am also getting these errors.
Thanks.
On Eclipse Helios click on the triangle pointing down on the Problems view, select Preferences then in the Preference dialog that appear, you can change the Limit visible items per group to change the value. Or else uncheck Use marker limits checkbox to allow all items being visible.
there is a triangle pointing down on the problems view, click on it, click configure contents, there will be "Number of items visible per groups:", change it
Just click on the arrow down in the Perspective and select Group by None.
or
Configure Contents...
In Eclipse Oxygen : Click the down triangle on the Markers panel, select Filters... , then untick the Use Limits check box in the pop up and then click OK.
Change the Fitter setting as following
The previous answers are all valid, but in Java, there is a further limit configured in the compiler preferences. This is why you may continue to see 100 items.
This article describes where to find the preference in question.
It looks like it's changed again - none of these answers seem to be valid with the current 2021-x versions.
First, find the Problems tab and look to the very right where you will find the Filters... button:
Once inside the Filters panel, look down in the bottom-left corner and either uncheck the Use limits checkbox or increase the limit from 100:
I had once a less obvious, maybe rare case where no errors and warnings were shown in the problems view. I was wondering why I don't see any entries, although I see a certain number of errors and warnings in the header of the problems view. All filters were switched off. It looked like that:
I found out that in my case the "Description" column was so small that I didn't realize, there is another column with entries that are just not visible. Resizing the column made the grouped warnings and entries visible again.
I'm finally making the voyage back to IntelliJ via Eclipse. Currently my Eclipse is set up so that if I currently have a statement such as this (where ^ denotes where my cursor currently sits):
foo.bar("hello"^)
and I hit the semi-colon (;) key, it will automatically put the semi-colon at the end of the statement:
foo.bar("hello");
Currently IntelliJ does this:
foo.bar("hello";)
Meaning I will have to explicitly type the closing bracket before typing the semi-colon.
Not a huge problem obviously but I have found myself putting the semi-colon in the wrong place a few times today as I make the transition back to IntelliJ and thought that it may be more efficient (for both my fingers and brain) not to have to type the closing bracket.
For Windows or Linux users, Ctrl+Shift+Enter.
For macOS/OS X users, ⌘ Command+⇧ Shift+Enter.
That finishes the statement you're currently writing. Try it in a few different situations, like in if statements, for loops etc, and you'll see that it'll complete the line and open some curly braces for you if necessary.
You can add a keymap of your own. I added Ctrl+; to my Keymaps for the "Complete Current Statement" action. This saved me an extra key stroke and made it a little bit more intuitive.
Go to Settings > Keymap
In the search box, enter "Complete Current Statement".
Right-click on the entry and select "Add Keyboard shortcut"
With the First Stroke field hightlighted, enter your key combination. E.g., Ctrl+;, which will display as Ctrl+Semicolon
Click OK, and OK to save and exit.
You can opt to remove or keep the existing mapping. Should look something like this when you're done:
if you want always have it just do this