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:
-
Using the debugger, viewing code structure, smart autocomplete, etc. I use vim bindings inside Intellij. – Rose Perrone May 20 '13 at 22:01
-
well, except for embedded visual debugger interface (for which VIM has its options, but I've never tried), it's able to please me much more than any IDE I've tried, at last for what I develop... (vim-instant-markdown, vim-colorschemes, YouCompleteMe, auto-pairs, SingleCompile, syntastic, nerdtree, vim-markdown, vim-fugitive, tabular, vim-ruby, vim-eunuch, ultisnips, rainbow, bufkill, vim-shell, gruvbox, vim-haml, hexmode, ctrlp.vim, ...). Because of this, these days, *I, personally*, practically have been relegating full-flagged IDE's just as debugging interfaces... =) – oblitum May 20 '13 at 22:52
4 Answers
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.

- 6,180
- 4
- 35
- 62
-
I applied this change to my settings, but nothing happens when I type past the margin. – Rose Perrone May 20 '13 at 22:07
-
There's probably an option buried somewhere to force the code formatting rules or to run the code formatting on file open. – Raystorm May 20 '13 at 22:35
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.)

- 41
- 3
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? :)

- 26,597
- 10
- 74
- 130
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.

- 31
- 5