IntelliJ left editor section - intellij-idea

Is there any way to decrease the left side with numbers of IntelliJ IDE?
It's way too big for me and takes away precious space of the screen.
Wasn't able to find any settings for that. Also no hints from google.

As already mentioned in the comments, you can't drag-drop or change a value easily so that the gutter is reduced in width. However, there are (as far as I can see) 3 things you can do to reduce (and actually almost eliminate) that whole section.
Starting with the least drastic one:
Remove the gutter icons.
Go to File > Settings > Editor > General > Gutter Icons and at the top you can completely disable them. That will significantly reduce the gutter size and won't be a (huge) pain for coding since these icons are just "nice to have".
Now the gutter will look like this:
A little bit more drastic is to remove the code-folding outlines.
Go to File > Settings > Editor > General > Code Folding and at the top remove the tick for code folding.
A very slight change, but at least something nonetheless:
Lastly, the most drastic (to me at least) action is to remove the line numbers.
I don't think that any programmer enjoys not knowing on which line they are on, but it will remove the gutter almost completely
Go to the Appearance section and un-tick Show line numbers. And the result will be:
In this case, at least the line number and character position are given at the bottom right, if that is even worth something...

Related

Pycharm - How do I set the page margin? [duplicate]

The other day I mis-clicked on and mis-dragged something probably and then the left "side bar" of the editor window got wider than normal.
Since this happened by mis-clicking and dragging, I don't know how to reset it back to the normal width. It simply doesn't respond when I try to click and drag the borderline. Didn't find anything related in Settings either.
It's not possible to change the gutter width at the moment. It adjusts itself automatically when needed (e.g. there is a gutter icon for override method and a breakpoint on the same line).
Looking at your screenshot, the width is actually standard. It needs some extra space to allow you setting breakpoints without accidentally clicking the line number.
You could submit a feature request/usability problem to https://youtrack.jetbrains.com/issues/IDEA, but to me, it seems fine.
But since you say it was different the other day and then something happened and it became wider, you could try starting PyCharm with default settings by renaming/removing configuration folder. Here is the article on how to find it.
Go to Settings -> Editor -> General -> Gutter Icon and uncheck the Show gutter icons.
But you should be careful: this action will hide information about recursive calls, override methods etc...

Intellij 14.1 Distraction free mode has a huge gap on the left side of the screen?

I'm really liking intellij's Distraction Free Mode. However when I try it on my machine, there is this big space on the left side of the screen. For some reason, even if I try to scroll to the left, the space is still there. It's like this huge margin on the left and it's eating a significant amount of space. How do I get rid of that? Here's a screen shot of what I have.
If you look at this blog, the space on the left side of the screen is very little. I want it to look like that. How do I do that?
Edit: Ok, somehow I discovered that if I hit ctrl + mouse scroll up, the big margin on the left sort of hides itself, but in the process, the text also becomes larger, which isn't really what I was looking for at the moment. The text is just too large by that point.
UPDATE: currently, aka 27 Dec 2015, there's an issue opened on their tracker regarding this feature/bug
The same blog you're indicating, states the following
In addition, the text is center-aligned!
This got me thinking, so I played a bit with the right margin features and, as you can see in the pictures below, the 2 seem related:
1. Right margin at 80 I have it at 120 and I can't recall the default value, but this looks like yours.
2. Right margin at 160
In conclusion, the larger the number, the smaller the right margin, and in addition so to speak, the smaller the left margin.
To get rid of the left gap in WebStorm increase the hard wrap value:
Settings > Editor > Code Style > your language > Wrapping and Braces > Hard Wrap at ...
Thank you! Works with IntelliJ 2019.1.1 as well.
CTRL+ALT+S -> code style -> increase hard wraps to > 200
The issue has been updated and a better solution is suggested by Tom Gregory. The solution updates the margin used for the distraction free mode.
For anyone coming to this bug looking for a solution, IntelliJ IDEA now offers a setting under Settings > Advanced Settings > Left margin in distraction free mode. Set it to 0 to achieve the desired result.

Multiple "right margins" or guides in PHPStorm

PHPStorm has a vertical line on what they call the "right margin" which is set by default to 120 characters or columns...
Given that PSR standards state There MUST NOT be a hard limit on line length; the soft limit MUST be 120 characters; lines SHOULD be 80 characters or less., it'd be nice if I could get another visual indicator at the 80 character mark...
I'm well aware that it says what line/column you're on in the status bar, but I typically hide most panels (status bar included) while coding.
Therefore, is there a way (feature or plugin) that would allow me to add a 2nd vertical line to indicate the 80th column?
It is not currently possible .. and no plugin comes into my mind.
https://youtrack.jetbrains.com/issue/IDEA-99875 -- star/vote/comment to get notified on progress.
P.S. Considering that this is rather PHP/Python specific (other languages do not care about this) .. I would not expect JB to have it implemented in nearest future...
I suggest the following workaround, it works for me on PhpStorm 9.0:
Open Settings page (usually Ctrl+Alt+S), go to Plugins -> Browse Repositories
Find and install BackgroundImage plugin
Restart IDE, it may output an error, something like "unknown protocol d" - don't worry, go forth
Make an image with height=1px, and width=(desired width of additional margin). Give it, say, white background and paint one rightmost pixel to say, black. I took a screenshot of an editor and cropped it in PS, to avoid annoying search and adjustment of the image width. Every change of background image requires to restart PhpStorm.
Open Settings again, goto Other settings -> BackgroundImage
Set Enabled checkbox, browse your created image, and check the FileSystem radio button
Restart IDE again and change the margin and you will get two margins
The image is left-aligned, so when you resize an editor on x-axis (move the splitter between Editor and Project View or File System View, etc.), the margin will remain truthy.
Some side-effects - it appears also on console window, event log, perhaps somewhere else.
If the plugin doesn't work, check out this page (there said that most JetBrains plugins should work on all products on IntelliJ Platform, and some workaround if they does not): http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
ADDED: Doesn't work with scaling an editor (Ctrl + MouseWheel) - the scale of the image (fake margin), remains the same and the margin becomes not truthy.
In the latest PHPStorm, this is now possible. This would be PHPStorm 2017.3. The instructions on the ticket mentioned in the accepted answer explains it quite well:
Will be available in the next EAP build. You can set it up at
Settings|Editor|Code Style|Visual guides for all languages or on
"Wrapping and Braces" tab for a specific language ("Other" tab for
XML/HTML). You can change the visual indent guide color at
Settings|Editor|Color Scheme|General|Guides|Visual guides. Please
submit separate reports if you find any problems.
I personally found the setting in Settings|Editor|Code Style|PHP|Wrapping and Braces|Visual guides. It should be there for every language.

Ignore whitespace changes in IntelliJ changebars

I have a file from our repository where I ran auto-indent (because it was a mess), and now the whole file is marked by blue changebars (down the right hand side of the editor window), making it difficult to find my changes.
I am already ignoring whitespace changes in the diff window (as described here: Intellij and changes tab), is there a way to also do this in the editor window?
I couldn't find a way to completely ignore whitespaces, but IntelliJ (I'm using version 2016) lets you set an option to color whitespace-only changes differentely:
Editor -> General -> Different color for lines with whitespace-only modifications
which helps tremendously.
At the moment [idea 13.5] it seems that is not possible to ignore spaces in the standard editor. You can open a support ticket
We also faced this in the company due the different codestyles used, at the end we settle for:
setting a common codestyle that everyone editing the code should [actually must] follow
reformat the whole codebase to the given codestyle
recommit the formatted code [without any addition or deletion, just the reformat]
It took just a bit of time, but at the end now we are working far better. In this way from that moment onward, we would have all the time the code that would aesthetically the same trough next versions.
You can completely disable the highlight of whitespace modified lines in :
Settings -> Editor -> Color Scheme -> VSC -> Editor Gutter -> Whitespace-modified lines
And then uncheck the background color :
Essentially, you want Intellij to use the --ignore-all-space or --ignore-space-change upon a merge.
My developer team also deals with this challenge because we have different code formatting preferences. The result is every merge is painful for no reason. The team loves being able to have their code formatting, but this negates it.
As of now there is no solution. Intellij has the technology to ignore whitespace, so fixing this is really just adding a check box on the merge diff screen or even in the version control settings.
There is a feature requests IDEA-107714
Please up vote it!
https://youtrack.jetbrains.com/issue/IDEA-107714
Try this,
View --> Active Editor --> Show whitespaces
this is guaranteed to solve your problem

Highlight lines that are too long

In vim, I can create a rule that highlights lines that are over 80 characters long. Can I do this in IntelliJ? Here's an example in vim:
I don't know if you can highlight. You might have to write a custom Code Inspection for that. But in Settings -> Code Style you can set a right margin of 80 characters and force automatic wrapping once you reach it.
Infact in Settings -> Code Style -> Java under the Wrapping and Braces Tab
there is the option Ensure right margin is not exceeded.
IntelliJ (at least v2016.2 and newer) has exactly this feature.
Under preferences go to: Editor -> Inspections -> General,
Then select: "Line is longer than allowed code style".
You can choose the severity you want, for most severities IntelliJ will underline the characters that exceed the line length limit (but you could change the style of the severity to look exactly like vim if you wanted).
(If it doesn't work, make sure "Right margin (columns):" is set under preferences Editor -> Code Style.)
You could add the JSLint Code Quality Tool.
You can set a maximum line length with that tool... if you so desire, you could disable everything else.
Then, in the Inspections part of your Project settings, enable the JSLint Inspection and set it to whatever Severity you like. This will probable highlight the whole line, but that's close enough, right? :)
I'm sure you've have already resolved this, Rose, but for other people who stumble upon this post, Raystorm's answer was correct. However, in order for the automatic line wrapping to occur, you must auto-format the code by typing Ctrl-Alt-L.