Multiple "right margins" or guides in PHPStorm - ide

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.

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...

How do I change highlighting on a dark L & F

Netbeans 9.0
Win10-64 & Win7-64
I've set my background to black - I forget the motif name and I can't find out how change it again. Java highlighting of same objects (methods, object names, etc.) is all but unreadable. I've tried to find a place to change it (Tools->Options->Fonts & Colors->Highlighting) and can't find the right highlighting option. Ditto for breakpoint highlighting.
And in addition, the cursor can not be seen. Probably the cursor color is black and can't be seen on a black background.
For example, click on internalFrame and others are highlighted and unreadable (the first 'internalFrame' is readable, the rest not):
JInternalFrame internalFrame = new JINternalFrame();
internalFrame.method1();
internalFrame.method2();
Is there a way to change these highlights?
Is there a way to change these highlights?
Yes, but you have to go to different places to change them, depending on what you want to change:
(1) To change most coloring for the edit window containing program source:
Tools > Options > Fonts & Colors
Select the Syntax tab, and then select Java (or whatever language you are using) from the Language drop list.
Most of the options you want to modify are probably listed in the Category window.
Beneath the Category window is a Preview window which will immediately show you the effect of changing the Foreground and/or Background colors for a given Category entry. As an (extreme) example, this screen shot shows the effect of changing the font color to yellow and the background color to red for Java identifiers:
Some Category entries which are not language specific (e.g. URL, Whitespace) can be found by selecting All Languages from the Language drop list.
There is a Restore button in the top right of the screen if you mess up, and want to revert to the defaults.
(2) To change the cursor color:
Tools > Options > Fonts & Colors
Select the Highlighting tab, and then select Caret Color from the Category window.
Select Foreground and Background colors as appropriate.
(3) To change the highlighting for breakpoint lines see the answers to the SO question How to change background color of line highlighting during debug process in Netbeans?
Notes:
Although you didn't ask, you also have limited ability to change the colors used in the Console windows: Tools > Options > Miscellaneous > select the Terminal tab.
There are many dark color schemes available for NetBeans, so if the one you are using has annoying limitations just try some of the alternatives. NetBeans 8.2 offers a few under Tools > Plugins > Available Plugins, such as Darcula LAF for NetBeans, Dark Look And Feel Themes and 2pmTech L&F.
Also, here are a couple of sites that offer many NetBeans themes with previews: https://netbeansthemes.com/ and http://svenspruijt.nl/themebuilder/

Intellij Idea - how to get rid of thick caret/cursor

I pressed something in Intellij and my caret shape changed to this. How to revert to the normal thickness? Using Intellij 2016.1.
Compare to this, normal thickness should be that of a bold vertical line:
Update: On Android Studio 2.1 beta, same machine, same font settings, cursor is visibly thinner.
You can .. but it's not pixel perfect. I mean -- for me the value does not seem to control thickness in pixels but rather some index (which gets applied to some predefined values) -- at least this is my impression on what I see my computer.
In any case:
Help | Find Action...
Search for registry action
Once in Registry window -- look for editor.caret.width entry
Set the new value (for me the default was 2) -- make sure that field went bold (move to another entry) to ensure that new value was accepted.
Restart IDE (this option requires it)
UPDATE (2017/04/06):
You may also try ThinCaret plugin:
Makes your editor caret 1 pixel thin (for retina users)
You can change it under Settings -> Editor -> General -> Appearance -> Use Block caret
Other caret settings are under Settings -> Editor -> Colors & Fonts -> General. Then if you scroll down to the editor section on the right, there is a caret item in the list with font/color settings.
Please check the Picture for solution.
If you got here because of the thick cursor (block cursor) that behaves differently than the normal thin one. Just press the insert (Ins) button once and you are good to go.
Go to the Keymaps section of the Preferences and add your own Keyboard shortcut if you are using a Mac. Windows users can just enable/disable Insert mode on their keyboard.

IntelliJ IDEA 13.1.2 javadoc and tabs

I hate to ask such simple questions, but nothing I found so far helped me...
So, I've recently started using IntelliJ instead of Eclipse and there are 2 things that really bothers me...
1.) size of javadoc popup window - ok, so I finally get this little guy to pop-up whenever I need it, but it's so small I have to use scroll every single time... and that's pretty anoying when I'm working with unknown libraries...
2.) tabs == spaces - maybe some of you like this, but I don't... Eclipse was treating tabs as tabs and not spaces... I tried to change settings but with no result... or is that maybe connected with project I'm working on? (meaning, if, at the start of a project, setting were such that tabs == spaces and now changes are not applied to it)
Sorry for stupid question but, as I said, nothing I found so far helped me...
1) Just resize the window with your mouse. It will retain the size the next time it opens. You can also click on the gear icon in the upper right corner and adjust the font size. Again, it will retain the size on subsequent use.
2) I'm assuming you make the change to the "Use Tab Character" option on the "Tabs and Indents" tab for all file types and saved the Code Style. After that, you need to run the Reformat Code action (Ctrl+Alt+L or Code > Reformat Code from the menu or Reformat Code from the context menu (i.e. right-click) in The Project Tool window or Navigation Bar). IDEA retains the previous formatting (so spaces in this case) until you run a reformat on the project (or a part of it).
If you have multiple projects already created, for each one, you will need to go into File > Settings > [Project Settings] > Code Style and set the Scheme (and then do a reformat). While the Scheme definition is saved IDE wide, the scheme to use is set per project (which makes sense since an Apache Open Source project you are working on may have different code style requirements than the projects you do at work vs the ones you do for fun).
Finally, you will also want to go into File > Other Settings > Default Settings > [Template Project Settings] > Code Style and make sure your saved code style scheme (with the use tab option) is set so that new projects use that scheme when they are created.

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