VIM like blank lines (after the last line) in IDEA - intellij-idea

I am faced with the problem... I'm using ideavimrc where I have have set
set scrolloff=30
Is it possible to set in IDEA VIM like blank lines after the last line so that my text will be ~ at the center even when the cursor is at the end of the line. See the picture...

You can try checkbox in Preferences -> Editor -> General -> Show virtual space at file bottom.

Related

How to shift multiple lines of code in IntelliJ by a single space?

Am trying to shift multiple lines of code in intellij IDEA by a single space using Tab shortcut but it always shifts by 4 spaces rather than a space. I have tried Edit > Convert Indent > To spaces but to no avail.
How do you shift multiple lines of code by a single space without messing with the default configuration for the file?
As #Andrey already suggested, I would use the Multi Cursor feature that has been around since intellij idea version 13.
I like the Add selection on Next Occurrence feature very much. It helps me to edit multiple lines very fast.
This screenshot shows the action in the Settings -> Keymap screen.

Getting PHPStorm to indent correctly when pressing enter inside a statement?

I have this code for example:
$sql = Yii::$app->db->createCommand("UPDATE {{%users}} SET foo=:foo, bar=:bar");
Now if I go in and put my cursor just before SET and press enter, PHPStorm will place the code at the start of the next line. Is there anyway to get it to indent so it goes under the UPDATE or similar automatically?
I think you are looking for "Continuation indent".
You can set this parameter in Settings -> Editor -> Code Style -> (the language you want) -> Tabs and Indents -> Continuation Indent (set to number of spaces you want)

Adding spaces in multiple lines simultaneously - in Pycharm

I occasionally need to go line-by line and change the indentation of the code.
Is there a shortcut in Pycharm where I can add spaces (format the indent) in the begining of multiple lines simultaneously without processing each line individually?
Highlight/ select the lines you want indented, then press TAB as often as needed until they reach the proper indent level.
You can remove spaces with SHIFT TAB.
You can also use CTRL+ALT+I to auto-indent the selection.
Select the block that you want to indent then press TAB. It will work.
To auto indent all the codes in Pycharm just press these sequencies:
CTR + A to select all the text files and then press
CTRL+ALT+I
Select all that you want to indent, then do CTRL+ALT+I to indent all of it. This should work in Pycharm
Use shift +alt on windows machine
Continuation indent for Mac pro: Preferences -> Editor -> Code Style -> the language -> Tabs and Indents
If Ctrl + ALT + I is not working and every time needs to press the Insert button to get the pointer.
So go to Tools -> Select Vim if it is checked then it will be disabled.
Now you can intend code directly selecting multiple lines.

How to force IntelliJ editor to restrict line length?

I have a text file that looks like:
a=12
b=13
c=14
d =15
e = 16
f = 17
Some of the numbers have spaces after them. Some don't. Some have tabs etc.
It seems that when i am in InteliJ's editor any place i click on is well .. clickable.
How can i restrict it by actual line length?
Settings -> Editor -> Allow placement of caret after end of line.
You can set the global code style to do things like put spaces around the assignment operator, and then do a global "reformat code" by selected text, file, or entire project.
I use IntelliJ 12:

How to remove unnecessary blank line on code formatting in IntelliJ?

Is it possible to remove empty/blank lines using code formatting in Intellij IDEA?
Yes. It is possible to configure the number of blank lines in the settings menu (CTRL+ATL+S): File -> Settings -> Editor -> Code Style -> Java(or Scala or whatever your language is) -> Blank Lines
File >> Setting >> Editor >> Code style java >>Blank lines tab
You should change to 0 in code label(as picture), It would remove all unnecessary blank line when press format shortcut: ctrl + alt + L
You can find and replace with regex option also ^(?:[\t ]*(?:\r?\n|\r))+. It searches all empty lines in file. You need to just replace it with empty
I use regular expressions to remove extra blank lines from the code. Here are the instructions.
Open Find and Replace dialog. Use shortcut CTRL+SHIFT+R.
In the search box type ^(?:[\t ]*(?:\r?\n|\r)){2,}. This will search for two ore more blank lines.
In a replace box type \n. This will replace with one blank line.
Open Reformat Code dialog and click Run. Use shortcut CTRL+ALT+L.
This works on all JetBrains IDEs. Use the screenshot as referece.
Just in case it helps someone using newer versions of Intellij, in Intellij IDEA 2016.2.4 it is File -> Other Settings -> Default Settings -> Editor -> Code Style -> Java(or Scala or whatever your language is) -> Blank Lines
For those trying to remove blank lines at the end of the file, this became a feature as of August 2020.
The proper place to configure this action is under Settings|Editor|General|On Save. Check "Remove trailing blank lines"