Vertical line between matching curly braces for java in eclipse
Solution 1
The closest solution I can suggest is:
Click on Eclipse IDE > Window > Preferences > General > Editors > Text Editors
Then click on the link "whitespace characters" to specify what should be shown.
Then enable tick box "Leading and Enclosed" for Tab only and leave the rest unchecked.
This is not perfect solution, but it might be useful.
Solution 2
There are useful plugins. Try: IndentGuide or EditBox
Solution 3
You can identify the matching curly braces in eclipse by position the cursor right after of the curly brace (the opening or the closing one) and the matching one will be automatically enclosed in a rectangle. You can't do what you said. After you position the cursor as I said , you can press CTRL + SHIFT + P to jump to the matching brace.
Solution 4
To my understanding this is not possible. Eclipse does have functionality that will help you work with brackets however, and it is actually a little more refined and user friendly then the Notepad++ style you are looking for.
- First, it has a feature for matching brackets highlighting under
Preferences->Java->Editor
. When your cursor is on a bracket it will highlight the matching bracket. - Along these same lines, if your cursor is on a bracket and you press
ctrl + shift + p
it will jump to the matching bracket. - It has line folding that can be toggled in
Preferences->Java->Editor->Folding
for brackets, comments, etc. - Double clicking after an open or close bracket will highlight everything in that code block.
- Eclipse supports automatic indentation as well. This should be a visual queue as to which chunk of code belongs to which bracket.
Hope this helps! Happy Coding!
Solution 5
Eclipse's structured editors (including the Java editor) provide a highlight of whatever structural element the cursor is within. The highlight is in the left border of the editor. For example, in the screen shot below, the cursor is in the listIterator()
method, and the highlight (pointed out with arrows) is highlighting the structural element, in this case, the Java method.
Unfortunately, I don't think the color or appearance of that highlight can be configured.
Jagdev Singh
Passionate software engineer and performance tuning expert.
Updated on July 09, 2022Comments
-
Jagdev Singh almost 2 years
I am new to eclipse IDE.
Can we do following in eclipse for java editor?{ | | }
How it is configured in eclipse to show vertical lines between matching curly braces in java editor? Is it possible?
-
Jagdev Singh almost 12 yearsI know these.Thanks for your answer.I am asking something like notepad++.
-
Xairoo almost 12 yearsYou can add that double clicking after an open brace will actually highlight everything within the braces. Really lets you see what is included. Same for perentheses.
-
Jagdev Singh almost 12 yearsAt the time of code review or writing some complex code we need to check which part of code is related to some other part.Specially when fixing a bug in others code.If this kind of feature is available then it will be very helpful.
-
Tim Bender almost 12 yearsWith code formatting enabled and a good set of style rules it should be fairly obvious what code belongs to a particular code block.
-
Jagdev Singh almost 12 yearsThanks to all for yours answers.I think it is not possible.I will go for CTRL+SHIFT+P option.
-
Jagdev Singh about 11 yearsThanks for reply.It is really useful.
-
mibrahim about 11 yearsIndentGuide does the trick. Select Help->Install Software and add the URL to "work with" atlanto.github.com/IndentGuide/update
-
Admin over 10 yearsDammit i hate it when people say "You can't". Thanks for this.
-
Milan over 10 yearsThanks for this! The IndentGuide adds vertical lines (Notepad++ like) to all indents and works in Eclipse PHP environment. FYI I had to restart Eclipse 2 times before it took effect.
-
Vipin about 10 years@mibrahim update url for IntentGuide is http://atlanto.github.com/IndentGuide/update
-
ladieu almost 10 yearsinstalled it, but it didn't do anything, perhaps it's out of date and doesn't work with the latest
-
Nenad Bulatović about 9 years@ladieu You have to go to the Window -> Preferences -> General -> Editors -> Text Editors -> Indent Guide, thene there 'Enable the indent guide', then 'Drawing options' select 'Draw guide on column 1' and 'Draw guide on blank lines', then 'Content types' check Text (and double check if all types of files that you ant are checked. Then close tab with Java code and when you reopen it you will have indent guides. I use it with every flavor (Java, EE, CDT, ADT) and editions (Luna, Kepler, Juno, Indigo) and it ALWAYS works. New url for update site is sschaef.github.io/IndentGuide
-
Alex Fainshtein over 5 yearsAs of October 2018, IndentGuide plugin is not available anymore; there is a frozen repository, in case somebody wants to clone and revive it: link. EditBox is still available, but looks quite heavy. It is much more than just indent guides. It does not seem there is any working indent guide plugin for Eclipse available...