How to change the tab character in IntelliJ IDEA when showing whitespaces?
Hi,
I've been using Eclipse at work for a few years now and decided to try another IDE for a personal project. I chose IntelliJ IDEA because I like how it looks and because of all the positive opinions I heard and read about it. However, I'm one of those weird people who can't edit a text without having whitespaces showing. On top of that, the whitespace characters must be visible but unobtrusive, just like the ones in TextPad and Eclipse (single or double guillemets).
The arrow, whether in IntelliJ or Notepad++ is just too much to bear for my eyes. Is it possible to change that character? I must confess that I've never seen any editor that allowed users to change that specific character BUT if I were on an editor dev team, I would implement it AND, IntelliJ being that "configurable", I hope there's a way. Unfortunately, I haven't found it so I was hoping a knowledgeable user would know enough to enlighten me as to whether this is possible and if so, how.
Thanks!
请先登录再写评论。
Hi Amenel,
No, it's not possible to change tab symbols representation at the moment.
How do you see such a configuration facility? E.g. let's say you want to change current tab symbol representation to something different - what do you want to get and how do you want to configure it?
Regards, Denis
Hi Denis,
thanks for your reply. Before I answer your question, please bear in mind that I am an advocate of "configurability" and the more a program/application is "tweakable", the more I, as a user, feel comfortable using it, all the more since I, as a developer, know it isn't that much more difficult to allow a user to pick a color or define their own shortcuts. That "tweakability" is probably the number one reason why I use Opera and don't use Mac OS X. What I'm trying to say is that making a program "my own" is important.
That being said, I'm at work now so no running instance of the program to see how the settings look like in IDEA. But what I see in general in an IDE is this: in the global editor settings, there's usually a "show whitespace characters" checkbox. Next to that, I would see either 1- a text input, where the user enters the character they want to see for the configurable visible whitespaces (right now, there are 4 of them I can think of : tab, space, CR, LF) or 2- a combo box in which some predefined characters are proposed.
How these alternatives display characters are used is pretty straightforward, just like the other predefined characters we have now: find a space/tab/etc. in the text, output the user-chosen character instead of the one that's currently hardcoded. If no alternative display character is defined, the space/tab/etc. in the text still has an effect but no rendering (i.e. a tab will still insert a tabulation and push the text on the next tabulation stop but nothing would appear on the screen).
Hi Amenel,
Thanks for explanation, your idea is clear but the problem with tabulation symbol representation is that it doesn't use any symbol as a representation sign at the moment. I.e. tabulation is shown as an arrowhead that occupies target number of visual column and that is implemented by direct drawing in terms of java2d api. That is the reason why I don't see convenient way to allow user to customize tabulation representation at the moment.
I see the point about application customization and agree that it may be rather important for some IJ users. From the other side, great number of application options really misguides users and makes it hard to find the one that is really necessary now.
Denis
Got it. I'll see how I succeed in adapting to the current state of things.
Thanks!
Hi Amenel,
I had the same problem, I haven't changed how tab symbol looks, but I did reduce it's visibility by changing its color to very white-like. Single space dots are hard to see now, but at least tabulations are less eye-bleeding now.
File -> Settings -> Editor -> Color & Fonts -> General -> Whitespaces -> Foreground: #F3F3F3 (my bg is #FFFFFF) -> OK.
Thank you Vyacheslav Kravchuk!
That was an effective solution!
Sorry for necro'ing an old thread but I'm having this issue right now. The whitespace character for tabs are very visually obtrusive, and the whitespace character for spaces look too much like periods.
I am using PhpStorm. I realize this thread is for IntelliJ IDEA but I think it's all the same IDE?
Any way we can get this to look more like how visual studio displays whitespaces? Theirs are cleaner looking.
Basically you would remove the horziontal lines for tabs, align the arrow to the left side of the tab instead of the right side, and align the whitespace character so it's centered vertically. Maybe give users an option to toggle how it's displayed - radio button "Style A" and "Style B" with default Style A being how it is currently so people who like the way its displayed currently don't see a change.
This is how MSVC looks with whitespaces:
Feel free to create feature request on YouTrack: http://youtrack.jetbrains.com/issues/IDEA.
I'm facing this problem as well. I prefer spaces in my own code but when I see 3rd-party code with tabs it hurts my eyes. Render them less intrusive please. Good references are Visual Studio Code, Visual Studio 2019, Atom, Xcode. I mean they use the same font (Consolas on Windows) but they render tabs not so intrusive. They should be rendered as small arrows with color close to background to be a little visible. Another option is to tweak which whitespaces to display: all, spaces or tabs. So, developer can display spaces only while keep tabs invisible.
I created an issue for Rider but it seems it is applicable for all products: https://youtrack.jetbrains.com/issue/RIDER-35926
The newest version of PHPStorm 2019.3.2 gives the option of two different character styles. The default is now simply a `>`. And you have the option of returning to the `-->|` rendering via editing PHPStorm registry settings.
From here:
https://jeremysawesome.com/2020/01/27/change-the-display-of-the-tab-character-in-phpstorm/
> ... the JetBrains team threw in a small registry setting to re-enable to old rendering of tab characters. This setting is available in version 2019.3.2. Access this setting by pressing “Shift” + “Shift” while in PHPStorm. Afterwards search for and select the “Registry…” option.
> You’ll find the
editor.old.tab.painting
option about a quarter of the way down the list. Check it to re-enable the old PHPStorm tab rendering...It's great news that this request of mine has finally found an answer, and a good one.
Unfortunately, my roots grew deeper in the Eclipse field, and I'm now actively involved in its ecosystem. The odds of me using a different IDE are slim. Still, great news and great implementation.