Does IntelliJ have the ability to tab out of auto-completed brackets? As in, when you press "tab" key near a closing bracket, the cursor will jump over it instead of adding a new tab. This is a pretty standard feature in Eclipse. In IntelliJ IDEA you must use arrow keys to do so.
Similar question was asked 4 years ago here, but maybe 4 year isn't enough time to complete this complex feature, so I'm asking again.
UPDATE:
Initial implementation for this feature is available starting from IntelliJ IDEA 2018.2 version. It works more like in MS Visual Studio - without visual indication of tab 'exit' position. For now, it should work in Java, SQL, Python and some other files. It will take some time for other languages to catch up - some language-specific code changes are required. The feature is disabled by default, you can enable it in:
Settings (Preferences on Mac)| Editor | General | Smart Keys | Jump outside closing bracket/quote with Tab.
Original answer:
Nothing new since the original question was submitted, except a third-party plug-in that was started by one of the users.
For some reason the author didn't release a binary version of the plug-in yet.
I went ahead and built the plug-in, you can get the jar file here.
Copy it into the IDE plugins folder, restart IDEA and use Shift+Space.
Keyboard shortcut can be changed in the Keymap settings:
Feature requests and bug reports should go here.
Just type in the closing bracket again, it will get you out of the bracket.
For example if you are typing "Sandeep", as soon as you enter ".. it will be like ""... then you enter rest of the text "sandeep".. and at the end type " again... it will take you out of the double quotes.
I have demonstrated above for double quotes , you can do the same for any brackets.
Related
After a long period of creating apps with Android Studio I returned to Eclipse to program a pure Java application. Of course, I have noticed large differences in terms of auto completion between IntelliJ IDEA and Eclipse but IntelliJ is no alternative for me because of various reasons.
That is why I started to change the settings in Eclipse, inter alia, for the content assist. I want to have suggestions for variable names too, without having to write a dot first. As you can see in this image, I have changed the auto activation triggers to ._#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ as suggested in another thread on Stack Overflow.
The problem is, if I write short variable names like d it completes them automatically to something different (in this case DEFAULT_CURSOR) when I press the dot key. To avoid this, I have to choose the variable first, before pressing the dot key.
However, having to do it this way is a large waste of time. Is there a possibility to use the suggested variables or methods only when I have pressed the enter key, just like in IntelliJ?
Maybe there is an option to bind the dot key to the closing of the content assist?
No, Eclipse and IntelliJ are different and IntelliJ's level of auto completion is unique to itself. If you are comfortable with it, you should use it and then copy and paste to eclipse for windowbuilder. Also FYI there is a free alternative to windowbuilder for IntelliJ, you can read about it here: WindowBuilder equivalent for IntelliJ?
I have used Eclipse for Java for the last few years and am trying out Intellij. I'm not using it permanently because it isn't as useful for quick programming (like how you can't just drag in files into the src folder) but for doing certain things, I think it will be faster for me.
I know there is Ctrl+Shift+Enter, but this is just annoying to press. Not because it is awkward to press, but because it takes so much time compared to just pressing enter like you can in Eclipse. I tried to rebind it to enter, but then it just doesn't work.
Is there a way to set up the Complete Current Statement so that it happens when I press enter?
Like, is there a way that I can bind it to Enter, but have it checked before the editor checks for enter as move to next line?
If you want only basic Code completion and not Type completion, use Ctrl+Space
IntelliJ and Android Studio are pretty highly customisable. You can rebind shortcuts too, I believe. Have you looked here? https://www.jetbrains.com/idea/help/configuring-keyboard-shortcuts.html
Also cheatsheet might be of use: https://www.jetbrains.com/idea/docs/IntelliJIDEA_ReferenceCard.pdf
And Android specific bindings: https://developer.android.com/sdk/installing/studio-tips.html
I need the exact same effect as in this question but in Eclipse.
It should only do the alignment if I explcitly insert a new line before the ":" or if the second operand (the "true" expression) is too long.
Example:
a = cond ? "a veeeeeeeeeeeeeeeery loooooooooooooooooooooooooooong string"
: "";
// ^ put the colon here
This original answer was for Galileo which is well over a decade ago, so I'm updating it to be a little more current. Original answer remains below.
For Eclipse 2021-12 (under Window though I hope it would be the same across platforms):
Go into Project, Properties on the menu.
Under Java Code Style, choose Formatter.
For the current project only, enable project-specific settings. For workspace settings, simply click on the Configure workspace settings. Then click the edit button.
In the selection pane, under Line Wrapping, Wrapping settings, Other expressions, there is a Conditionals item that you can edit.
The options you want are:
wrap before operators;
wrap where necessary;
no force split; and
indent on column.
They give this as an example:
This is the dated answer for Galileo:
Go into Project, Properties.
Under Java Code Style, choose Formatter.
For the current project only, enable project-specific settings. For workspace settings, simply click on the Configure workspace settings. Then click the edit button.
On the line-wrapping tab, choose Expressions, Conditionals.
Choose the relevant line wrapping policy and indentation policy.
I have "wrap only when necessary" and "indent on column" which appears to be close to what you want.
If you're not running Galileo, other versions of Eclipse should at least be close to that process. If my settings aren't quite what you want, you may need to fiddle with them a bit, but that Formatter section is pretty well the entire exposed interface so, if it can't be done with that, it can't be done (short of writing your own plug-in or finding a more configurable third-party one).
I have a problem, with multiple possible solutions.
I'm doing a Computer Sience study and I'm working as an intern at the moment. My assignment is to make a business application for Android & iOS. I've been working for 2 years with Visual studio 2010 now, Xcode is rather simular so that's no biggy, Eclipse on the other hand is not as what I'm used to, I'm not saying it's bad. I have enjoyed Eclipse so far but now i'm constantly using Xcode and Eclipse
Now hold on there before you answer! I know there is an autocomplete in Eclipse but it will only pop after you push Ctrl + Space or after one of the maximum of four Auto activition triggers is, well, triggered.
So my question is:
Is there any tool that does trigger auto complete after every keystroke or something?
I tried looking at making my own Eclipse plugin but it was way to hard with zero knowlegde about the Eclipse API, although tutorials considering the Auto Complete features are welcome! (they should cover classes like ContentAssistCommandAdapter)
Thanks in advance!
The delay between keystroke and pop-up is configurable. So, as an alternative to a plug-in, you can adjust the autocomplete settings to pop-up after a shorter period of time, such as 1/10th of a second.
Eclipse preferences ->
Java ->
Editor ->
Content Assist ->
Enable Auto Activation
Auto activation delay (ms)
(showing Mac OX 10.6, running Eclipse "Indigo" release, but the option has been around forever):
I've started up with developing Java.
However, These days I've started iPhone project and gave me lazy writing code;auto code generate functionality in xCode.
Are there any non-pay free edition add-on exist that does similar to xCode?
I mean, I do know Eclipse already has partial auto method look up when you put '.' (dot) token after class name which shows the list of methods.
thank you all.
The functionality is called content assist in Eclipse. It comes as default.
To trigger content assist, normally you have to click Ctrl+Space (Windows/Linux). But as you said, on Java it will be auto-activated when user press ..
You can however change this behavior. Go to Preferences -> Java -> Editor -> Content Assist and change the Auto activation triggers for Java.
For example to get the behavior of xCode, you could change it to ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.
It comes by default with eclipse.
You need to press . then ctrl + spacebar
If ctrl + space doesn't work, you may try Alt + /
I used to think the autocompletion was slow, but it turns out you can make it instant. Go to Window / Preferences / Java / Editor / Content Assist / Auto-Activation and decrease Auto activation delay to zero.
I've been using Code Recommends. This is a very useful Eclipse plugin you must have.
One of my most favorite functionality is
Subwords Completion (you don't need to remember exactly the first letter of method's name, just type in other whatever letter you remember even they're inside).
It also offers many other functionality that may meet your need.