Wrapping chained method calls on a separate line in Intellij for Java

Small disclaimer: this is IJ 14.4, it’s possible that in later versions it may have been changed/renamed/etc, but it should be there somewhere nonetheless Go to Settings -> Editor -> Code style -> Java and select the Wrapping and Braces tab, then scroll to Chained method calls. Check the little combo on the right of … Read more

Best word wrap algorithm? [closed]

Here is a word-wrap algorithm I’ve written in C#. It should be fairly easy to translate into other languages (except perhaps for IndexOfAny). static char[] splitChars = new char[] { ‘ ‘, ‘-‘, ‘\t’ }; private static string WordWrap(string str, int width) { string[] words = Explode(str, splitChars); int curLineLength = 0; StringBuilder strBuilder = … Read more

Is there any way to get vim to auto wrap python strings at 79 chars?

More a direction than a solution. Use ‘formatexpr’ or ‘formatprg’. When a line exceeds ‘textwidth’ and passes the criteria set by the ‘formatoptions’ these are used (if set) to break the line. The only real difference is that ‘formatexpr’ is a vimscript expression, while ‘formatprg’ filters the line through an exterior program. So if you … Read more

When you write TeX source, how do you use your editor’s word wrap?

I recently switched to hard-wrapping per sentence (i.e., newline after sentence end only; one-to-one mapping between lines and sentences) for two reasons: softwrap for a whole paragraph makes typos impossible to spot in version control diffs. hardwrapped paragraphs look nice until you start to edit them, and if you re-flow a hard wrapped paragraph you … Read more