Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set the line limit length for different types of files?

I have the following gray line that limits the number of characters a single line can accomodate:enter image description here

I'd like to change the line length (this fill probably affect where this line is currently shown right now) for different files: for js, php files etc one line length, for HTML template files another. Is it possible? If not, how can I change at least for all file types?

like image 766
Max Koretskyi Avatar asked Feb 19 '14 07:02

Max Koretskyi


People also ask

Is there a line limit in text files?

mode): 32767, otherwise 2147483647 characters. Longer lines are split. Maximum number of lines 2147483647 lines.

How do I set line length in Intellij?

To configure the line length, open settings Ctrl+Alt+S , navigate to Editor | Code Style, and type the necessary length in the Hard wrap at N columns field. Wrap if long: break a section of text into lines so that each line fits the configured line length.

How do I set line length in Pycharm?

File -> Settings ( Ctrl + Alt + S ), then Editor -> Code Style : To follow PEP-8 set Hard wrap at to 80. Save this answer.


3 Answers

This is now possible as the bug linked by @LazyOne has been resolved. You can now set different right margins for different programming languages.

The setting is under Settings | Editor | Code Style | <Your language> on the Wrapping and Braces tab at the very top of the list.

PhpStorm settings interface

like image 118
Chris Avatar answered Oct 09 '22 20:10

Chris


Default value can be set at

Settings/Preferences | Editor | Code Style --> Right margin (columns)

enter image description here

Since end of 2014 (after IDEA-59662 ticket was implemented) most languages have an option to adjust that value in language-dedicated section. For example: PHP

enter image description here


For unsupported languages .. or those that do not have such option -- you may try going with .editorconfig file and EditorConfig Support plugin -- should work.

like image 23
LazyOne Avatar answered Oct 09 '22 18:10

LazyOne


For those who are from 2018:

Settings/Preferences | Editor | Code Style | Hard Wrap At enter image description here

Or Settings/Preferences | Editor | Code Style | Your Technology(ex. PHP) | Hard wrap at

enter image description here

like image 7
Artem Kovalov Avatar answered Oct 09 '22 19:10

Artem Kovalov