How to move line's number position in Rider? - intellij-idea

I'm using Rider distraction free mode as described in this post and I would like to move the line number closer to the green bar because it is a little troublesome to know which line number a certain piece of code is.
EDIT: I want the block of code to be in the center.

There is no way to have the code centered and the line numbers displayed next to the centered code, please vote for the corresponding feature request.
It's only possible to move the code to the left so that it's closer to the line numbers:
Settings (Preferences on macOS) | Advanced Settings | Left margin in distraction free mode: 0.

Related

PhpStorm IDE: Keyboard Home/Pos1 should move caret to real beginning of the line (character position 0) instead of the beginning of the first word

I'm in the process of switching (with some specific PHP production context) from Sublime Text(4x) to PhpStorm (2022.2).
I am of course trying to migrate as many features/habits as possible, as identical as possible to my new environment. Many things I have managed to do but I have a showstopper when it comes to using/keymapping the Home-/Pos1-Button as I was used to.
What I want:
Being somewhere in a line of (PHP) code I want to press the Home-/Pos1-Button to immediately get to the (really) first character(0) of the line which is the widespread default behaviour of that key.
What I get (problem):
When I hit that button once PhpStorm IDE moves the caret to the beginning of the first word/non-whitespace character of the current line and I need to hit the key again to really get to the beginning of the line. I have tried a couple of things but I get the feeling this is "intended" non-configurable behaviour...
Any help would be greatly appreciated.
I tried googling and configuring Settings > Editor > Keymap in many ways but did not succeed...
Go to Settings (Preferences on macOS) | Editor | General | Smart Keys | Home moves caret to first non-whitespace character -> disable.

How to find the name for indentation of object-attributes in .tsx-file in PhpStorm

I'm editting a .tsx-file and are reaching upon this bonkers file-formatting:
... If I enlarge the window a bit, then it makes more sense:
But I would still like to change it, so value and onClick aren't aligned all that way to the right. Ideally, it would try to align them with the opening bracket (as they do), unless the opening bracket is more than 35 characters, from the line start. Or something like that.
Now, I assume that it's the TypeScript-formatting that dictates the Code Style for a .tsx-file. But when I open the settings: Editor >> Code Style >> TypeScript then there are BAZILLIONS of settings.
Which leads me to three questions:
Does anyone know what I need to change, so object-attributes doesn't follow the opening-brackets width?
Could I find the name of what I'm looking for, in some smart way? I tried hovering over the massive space, hoping that the little yellow light-bulb could shine some light on, what I was after.
Are there any presets, to be found somewhere? So I don't need to engineer a new Code Style, if I dislike the default.
Make sure that the following option is disabled:
Settings (Preferences on macOS)
Editor | Code Style | TypeScript | Wrapping and Braces
Function call arguments: Align when multiline
NOTE: It is possible that the default value has been changed somewhere since the previous version as I have seen a few questions for the same option but different language (PHP and JavaScript).
HINT 1: Did you know that you can paste your own code in the preview area and start changing options to see how they will affect it? It helps locating the right option a lot.
HINT 2: There is a special popup that shows formatting rules applied to the code. It does not show all possible options but can give you a hint what to look for. To invoke it:
Use Help | Find Action... (or Action tab on Search Everywhere -- they use to be different popups but are using the same popup nowadays)
Type adjust to filer actions
Select and invoke "Adjust code style settings" action
It will give you a popup with applicable rules (it's a limited set: may not list all).
An example for PHP code:

IntelliJ left editor section

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

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.