Questions tagged [autoformatting]

A software feature commonly found in word processor programs such as Microsoft Word that automatically changes the formatting or appearance of text.

A software feature commonly found in word processor programs such as Microsoft Word that automatically changes the formatting or appearance of text. For example, if a user types "1st", AutoFormat would change this to "1st."

213 questions
672
votes
9 answers

How To Auto-Format / Indent XML/HTML in Notepad++

Is there a way to re-indent a block of code? I'm looking for something similar to Ctrl+Shift+F in Eclipse (Auto-Format/Indent). To be clear, I already know how to format XML outside of Notepad++ (Eclipse works fine, as mentioned) so I don't need a…
SBoss
  • 8,255
  • 6
  • 25
  • 44
75
votes
5 answers

Auto-format R code in RStudio

Is there any possibilities for auto-formatting code in RStudio? I found this, but it is not connected with RStudio. Also it is desirable that it be customizable formatting.
midas
  • 1,488
  • 2
  • 16
  • 20
43
votes
3 answers

How do I Change VSCode To Indent 4 Spaces Instead Of Default 2?

I have applied the below settings in VS Code to get 4 spaces indentation. But always when I open a new file, it switches back to 2 in the right-bottom corner. If I click in the right-bottom corner and change the setting back to 4, VSCode will…
35
votes
7 answers

Is it possible to auto format PHP in Sublime Text 2?

In Sublime Text 2, I am trying to type the code and have auto format command to rearrange and auto indent source code. If it is not possible to have a automatic formatter, would be nice to have a shortcut command to do it. I am searching for…
Junior Mayhé
  • 15,301
  • 26
  • 105
  • 157
29
votes
2 answers

Eclipse auto-formatter, disable auto line-wrapping of comment lines

I love eclipse auto formatting, but there's one feature that's driving me raging mad: Since I use wrap-lines in my auto-formmatter, code like this: private static Location _location = null; // this is a…
Gal
  • 4,789
  • 5
  • 31
  • 50
26
votes
4 answers

How to disable all whitespace autoformatting in Visual Studio 2015?

I really like the new Visual Studio 2015, but the auto formatting is a bit too much extensive for my liking. Especially I like to have control over whitespace: public class TipStats { public int Points { get; set; } public int …
Dirk Boer
  • 7,007
  • 9
  • 49
  • 89
25
votes
2 answers

Auto formatter changes > > to >>

I'm having a problem with the C++ extension of VScode. Whenever I define a matrix consisting of vectors like vector > and use the auto formatter, it changes the code to vector> which results in a compiler error. Is there any…
ErebosM
  • 558
  • 1
  • 5
  • 21
23
votes
5 answers

autoformat code from command line

Is it possible to run auto-format code for all or for specific file in solution, like (Ctrl+K, Ctrl+D) formatting in Visual Studio but from it`s command line? Or use Resharper's cleanup also from command line for solution files?
22
votes
5 answers

Visual Studio/C# auto-format. Can I control newline after attributes

Visual studio keeps doing this: [DataContract] public class MyContract { [DataMember] public bool MyBool { get; set; } [DataMember] public string MyString { get; set; } } I would like this: [DataContract] public class MyContract…
Clyde
  • 7,723
  • 8
  • 53
  • 83
20
votes
5 answers

A list of useful Python commands for Vim?

I was looking for a quick way to autoformat/pretty-print JSON in Vim the other day and found this great little command on Stack Overflow: :%!python -m json.tool That sent me on a search for a list of other Python tools to pretty-print common web…
johnmdonahue
  • 653
  • 7
  • 16
20
votes
1 answer

How do I keep Resharper from massively indenting lambdas?

I have Resharper installed with mainly default settings. Currently, I'd like my multi-line lambda expressions to look something like this: foobarclass.biz.baz.Event += (s, e) => { foo.Bar.DoThings.Whatever(); }; However, Resharper…
Earlz
  • 57,517
  • 89
  • 275
  • 484
17
votes
3 answers

Prevent VSCode auto format on save from removing final newline

I am using the last feature of VSCode called formatOnSave, which is super cool. I have one tiny problem, the formatter tends to delete the new line at the end of json files like packages.json for example. My linter want those new lines at the end…
Cyril Gandon
  • 15,798
  • 12
  • 69
  • 116
17
votes
6 answers

tool to auto-format R code

Is there any tool (editor, script, whatever...) available that can automatically reformat R code? It does not need to be customizable but it must be able to recognize statements separated by either semicolons or newlines since this code has both. If…
Keith
  • 2,686
  • 4
  • 25
  • 38
16
votes
1 answer

make Clang-Format ignore comments for line break

Is it possible to tell Clang-Format to ignore comments for line break operations? The idea is to follow the style "the code is well formatted, even if comments exceed the line break margin". Code should not be split in multiple lines, if it does not…
yar
  • 1,653
  • 9
  • 24
16
votes
5 answers

How can I automatically tidy up Perl source code?

A cat at my company walked over a keyboard and has left a valid 1000+ line of executable Perl code for me to maintain. Thanks to Perl's TMTOWTDI philosophy I find myself searching Google to make sense of every line of code she has produced. To add…
Ankur Gupta
  • 2,276
  • 4
  • 27
  • 40
1
2 3
14 15