I noticed with the new IntelliJ update, that it turns symbols like >= into the actual math greater than or equal to sign, along with arrows (->) and things like that. How do i turn this feature off and just get the raw characters.
Thank you
It seems like whatever font you are using supports ligatures, and IntelliJ is set to render them too.
To change the settings, first go to "File > Settings" and then select "Editor > Font" tab:
Either:
select a font that doesn't have ligatures, or;
uncheck "Enable font ligatures"
Related
Most germans probably know the hassle to reach specific symbols like "{" or "}" within the german keyboard layout, that are often used, when programming in java.
Does anyone know a simple way to rebind those keys for the java editor in eclipse? I'd love to have it the following way, but I am open to alternatives too, as long as they are easy to reach:
ALT GR + Ö results in "{"
ALT GR + Ä results in "}"
I tried several third party keybinding tools like Sharpkeys, but most of them don't recognize those specific german keys within their layouts. I also tried inner eclipse solutions like templates, but those don't feel naturally to use, since you can't bind them to a key. I also tried macro add ons, but those usually can only hold the last recorded macro.
Anyone with a nice clean idea on how to solve this?
OS = Windows 10
You could do the following to type ö/ä followed by Enter for {/}:
In Window > Preferences: Java > Editor > Templates:
Click New...
Enter/choose the following values:Name: öContext: JavaDescription: {Pattern: {
Repeat the last two steps for ä and }
In Window > Preferences: Java > Editor > Content Assist add öä as Auto activations triggers for Java (by default it is ., so change it to .öä)
Result: In the Java editor, if you type ö/ä, the content assist automatically opens and hitting Enter will select the ö/ä template.
I have this line showing the problem:
Which setting in the Eclipse Java formatter do I have to change so the line will break like
return this.data.getNumberOfGenerationsWithoutSignificantImprovementPassed()
> MAX_NUMBER_OF_GENERATIONS_WITHOUT_SIGNIFICANT_IMPROVEMENT;
or like
return this.data.getNumberOfGenerationsWithoutSignificantImprovementPassed() >
MAX_NUMBER_OF_GENERATIONS_WITHOUT_SIGNIFICANT_IMPROVEMENT;
? If both is possible, I prefer the former.
On Mac, go to Eclipse -> preferences. On Windows, I believe it is Windows -> preferences... but don't quote me on that!
Expand Java -> Code Style -> Formatter
To the right of the "Active profile" bar, choose edit.
A new window will open- choose the "Line Wrapping" tab.
Scroll down to "Expressions" and choose conditionals. Pick your favorite!
Bonus points: This is where you can set all sorts of different styles, if you have not before, like number of spaces per tab character. Once you get everything set up just right, name your profile and export it. I use the same theme on 3 different computers and the consistency is nice!
I'm using Checkstyle for Java in Eclipse IDE. I don't know in every java file, at second line, I always receive warning in Checkstyle : (although I'm pretty sure that I don't press tab key)
File contains tab characters (this is the first instance).
public class Percolation {
private boolean[][] grid;
...
}
When I have typed : public class Percolation {, press enter, Eclipse will make an indent for me, after that, I type private boolean[][] grid;. But, I still receive this warning.
Please tell me how to fix this. (I don't want to turn off this warning, because this is a must. Another people will check again my file).
Thanks :)
step 1 In eclipse, Preference > Java > Code Style > Formatter. Edit the Active profile.(If you don't wish to edit the built-in profile , create a new profile). Under "Active profile:" there is a drop down dialogue box .. beside it, click "Edit..." which opens up the edit dialog box. Under the "Indention" tab, you'll find Tab Policy. Change the Tab Policy from Mixed to Space only & apply the changes.
step 2 Back to your Eclipse Perspective, navigate via the menu bar: Source > Format Element (not "Format") and save.
Run checkstyle you won't find "File Tab Character: File contains tab characters (this is the first instance)." warning anymore.
To visualize the difference by enabling whitespace character that you'll find in tool bar.
In eclipse, go to Preferences > General > Editors > Text Editors
and check the box for "Insert spaces for tabs". Then it will indent with spaces instead of tabs.
another possibility is find and replace:
- copy a tab
- Got to Find and Replace Window
find: paste the tab
replace: type 4 whitespaces (or number of whitespaces a tab consists of)
-> replaceAll
For Java code:
step 1 In eclipse, Preference > Java > Code Style > Formatter. Create a new profile and initialize it with default profile. There is a drop down dialogue box .. beside it, click "Edit..." which opens up the edit dialog box. Under the "Indention" tab, you'll find Tab Policy. Change the Tab Policy from Mixed to "Space only" & apply the changes.
step 2 Correct Indentation of your code by ctrl+I. It will replace Tab with Space.
To fix this Navigate to Preferences > Java > Code Style > Formatter.
Then click on New > give name for the formatter > click on ok.
Once you complete this step, on the automatically popped up window which is the formatter you created, click on indentation > tap policy > select space only.
Or if you come back later time you could click on edit and follow the same step.
in the indentation size I prefer to put 4 > click apply and close.
After that right click on the class file you want to format > source > format.
This will cause the indentation to be spaces instead of tabs.
I was also facing the problem but I got the solutions.
Step 1 : Go to Window > Preferences > Checkstyle.
Step 2 : In the right side You will see the Global Check Configurations. There you will find that Two configurations are available. Select the configuration with Eclipse and click on Set as Default button and click on OK.
Hope this will solve your problem.
For Java Editor
Click Window » Preferences
Expand Java » Code Style
Click Formatter
Click the Edit button
Click the Indentation tab
Under General Settings, set Tab policy to: Spaces only
Click OK ad nauseum to apply the changes.
For other editors refer here How do I change Eclipse to use spaces instead of tabs?
Simply fixed that style issue (triggered by scalaStyle) by removing TAB with SPACE indent :)
I use Eclipse IDE and Window Builder Pro for create window.
When I go to the source code I see a big indent text. How to delete ?
How about good old Shift + Tab?
If by "how to delete" you mean to say that you want to decrease the indentation level, try this:
Go to
Window->Preferences->general->Editors->Text
Editors
There specify the indentation level under :
Displayed Tab Width.
Additionally you can customize you formatting in Eclipse as :
Go to
Window->Preferences->Java->Code
Style->Formatter
Select the formatter and press Edit. Use whatever suits you.
Then Select the text you want to format and press Ctrl+Shift+F
If you want to fix indent only you can select lines and press Ctrl-I.
Take a look at Eclipse keys
Most likely you insert tab character which is being expanded to 8 positions in target IDE.
Change setting in Eclipse to insert 4 spaces (or whatever your style is) when tab is pressed.
Then you can try to reformat your file in Eclipse. Also, you can use sed to replace \t with 4 spaces.
If you like the way your formatter is set up for the rest of your code, perhaps telling the formatter not to work on this section would be desirable. Then you can unindent the section to make it visually appealing and not worry about it changing formatting.
Linked solution works in Eclipse 3.6.
In eclipse, when your cursor is placed on a method (or other things), other places the method exists are highlighted. I'd like to change the color of this highlight, but after scouring the eclipse preferences many times in all 3 places, I have yet to find it.
Any of you Eclipse gurus know where to find this option?
After running around in the Preferences dialog, the following is the location at which the highlight color for "occurrences" can be changed:
General -> Editors -> Text Editors -> Annotations
Look for Occurences from the Annotation types list.
Then, be sure that Text as highlighted is selected, then choose the desired color.
And, a picture is worth a thousand words...
(source: coobird.net)
(source: coobird.net)
For those working in Titanium Studio, the item is a little different: It's under the "Titanium Studio" Themes tab.
The color to change is the "Selection" one in the top right.
1 - right click the highlight whose color you want to change
2 - select "Properties" in the popup menu
3 - choose the new color (as coobird suggested)
This solution is easy because you dont have to search for the highlight by its name ("Ocurrence" or "Write Ocurrence" etc), just right click and the appropriate window is shown.
If you're using eclipse with PHP package and want to change highlighted colour then there is slight difference to above answer.
Right click on highlighted word
Select 'Preferences'
Go to General > Editors > Text Editors > Annotations. Now look for "PHP elements 'read' occurrences" and "PHP elements 'write' occurrences". You can select your desired colour there.
right click the highlight whose color you want to change
select "Preference"
->General->Editors->Text Editors->Annotations->Occurrences->Text as Hightlited->color.
Select "Preference ->java->Editor->Restore Defaults
in my case (Eclipse IDE 2021-06), dark theme, the issue was with the background color of "C/C++ Write Occurrences".
On each click over a variable being written in the code, the editor highlights all occurrences of that variable.
You can find this setting here:
General -> Editors -> Text Editors -> Annotations
and then select 'C/C++ Write Occurrences'.
And finally change che Color property.