Home > Visual Studio > Visual Studio 2012 Format Code Not Working

Visual Studio 2012 Format Code Not Working


Reply MikMik says: December 5, 2014 at 1:53 am Is there a way to prevent it from screwing up comments? You can try mine extension Format Document on Save share|improve this answer answered Jan 24 '14 at 13:15 mynkow 1,80111849 add a comment| up vote 3 down vote Under Under Tools CyrusNajmabadi referenced this issue Oct 15, 2016 Merged Allow disabling of formatting while typing. #14543 CyrusNajmabadi closed this in 24d3c34 Oct 17, 2016 Sign up for free to join say the code being moved is anchored to something else. have a peek at this web-site

If you go to EDIT -> Advanced, you will actually see the shortcuts listed as CTRL + E,D and CTRL + E,F. If it helps in any way change "keep tabs" to "keep indention tabs" and "keep alignment tabs". ...some people have asked for tabs to get replaced with spaces... Tried this on a javascript file as well. Click the arrow to the right of the toolbar > Add or Remove Buttons > Customize... > Commands tab > Add Command... http://stackoverflow.com/questions/16062057/how-to-auto-format-code-indentations-in-vs2012

Visual Studio 2013 Format Code Shortcut

Note that this has always essentially been the case. share|improve this answer edited Jun 23 '15 at 13:44 answered Jun 23 '15 at 13:39 Ewan 5519 add a comment| up vote 1 down vote Cut/Paste of a section is another Taxing GoFundMe Donations How do you combine the elements in Sheldon's T-shirt?

  • Why do Internet forums tend to prohibit responding to inactive threads?
  • Check all three formatting check-boxes.
  • How not to lose confidence in front of supervisor?
  • HTML, ASPX) will be formatted and empty lines will be deleted.

tabs vs spaces is only about controlling your indentation of code. Enjoy! Should I have doubts if the organizers of a workshop ask me to sign a behavior agreement upfront? Visual Studio 2015 Format Code No matter what programming language you work with, there are settings you can control that affect the readability of your code.

up vote 252 down vote favorite 81 In eclipse there is a shortcut Ctrl+Shift+F that re-indents code and fixes comments and blank lines. Visual Studio Auto Indent Shortcut What should I pack for an overland journey in a Bronze Age? Posted by Peter Vogel on 01/30/2015 at 10:18 AM Printable Format Please enable JavaScript to view the comments powered by Disqus. http://stackoverflow.com/questions/4942113/format-code-shortcut-for-visual-studio Telekinesis resistant locks What is this word problem asking?

That's because, otherwise, we'd need an option to reflect how any piece of whitespace might be changed between any two tokens. Visual Studio Auto Format Shortcut more hot questions question feed lang-cs about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation There is currently no way for a user to say i do not want the tab to be touched here. I work mainly with web sites so html, C#, js, css, sass and Razor.

Visual Studio Auto Indent Shortcut

Sign in to comment Contact GitHub API Training Shop Blog About © 2016 GitHub, Inc. https://blogs.msdn.microsoft.com/zainnab/2013/08/20/visual-studio-2013-format-the-current-document-or-selection/ Just go to Tools | Options | Text Editor | C# | Formatting | Spacing Some people prefer spaces around expressions in if statements to make them more readable. Visual Studio 2013 Format Code Shortcut Are we in a low CO2 period, compared to the last 590 million years? How To Format Code In Visual Studio 2013 Join them; it only takes a minute: Sign up How to auto format code indentations in VS2012? [closed] up vote 10 down vote favorite 5 How to auto format code in

Tags format document format selection visual studio 2013 vs2013 Comments (15) Cancel reply Name * Email * Website Leonardo Lourenço Silva says: August 20, 2013 at 7:52 am Great Reply Roger Check This Out Reply Anonymous says: March 20, 2014 at 10:09 am Agreed with LeeC. Now, since moving to that model, it's clear that that's something that's making some people very unhappy. Personal Open source Business Explore Sign up Sign in Pricing Blog Support Search GitHub This repository Watch 901 Star 6,520 Fork 1,559 dotnet/roslyn Code Issues 3,235 Pull requests 151 Projects Format Code In Visual Studio Code

Then you just select text and click the Increase Indent or Decrease Indent buttons. Should I delete it if it doesn't help anybody? –mitaka Apr 19 '13 at 14:26 | show 1 more comment 2 Answers 2 active oldest votes up vote 27 down vote I've read some of these discussions, but always think it is something that the user should decide. http://stickersweb.com/visual-studio/visual-studio-2010-format-code-not-working.php My boss asks me to stop writing small functions and do everything in the same loop What Russian letter is this?

Simple geometry. Visual Studio 2015 Auto Indent Always override the spacing option. share|improve this answer answered Jul 10 '15 at 18:08 Sergey Vlasov 8,55311924 add a comment| up vote 0 down vote Just to further Starwfanatic and Ewan's answers above.

Reply bhanu korremula says: May 19, 2014 at 10:26 am formatting is not working it does not much.

Document Format and Selection Format are both under the Edit group. (Tested in VS2010 and VS2013) share|improve this answer answered Jan 7 at 3:10 spaced - out 12 add a comment| Chess : The Lone King Let me tell you a little about myself Do n and n^3 have the same set of digits? Because auto-format changes all existing tabs with spaces, a LOT of lines marked as different when comparing source files with previous ones. Visual Studio 2015 Format Code Shortcut Can you tie up these Laurent sequences?

JoeBug commented Apr 6, 2016 @CyrusNajmabadi: Thanks for your reply! In that particular case I've found if I ctrl+z then the formatting is removed but the pasted code remains. For more information, see Tabs, All Languages, Text Editor, Options Dialog Box. http://stickersweb.com/visual-studio/visual-studio-2012-format-document-not-working.php JoeBug changed the title from Visual Studio 2015 code format issue to Visual Studio 2015 C# code format issue Jan 28, 2016 Pilchie added Area-IDE Bug labels Jan 28, 2016 Pilchie

Now, if we were to keep tabs then the items might move around oddly (and may become unaligned). Reply Sergey Vlasov says: July 10, 2015 at 11:12 am There is now the Continuous Formatting extension that can automatically format code in background as you type: visualstudiogallery.msdn.microsoft.com/08afc8d1-4b74-44df-b012-f225ee9e9220 Reply Follow UsPopular Spaces Did you know you can control whether you have spaces around parameters in method calls, or expressions in your if statements? Other formatting options are under Edit » Advanced, and like all VS commands, you can set your own hotkey via Tools » Options » Environment » Keyboard (the format selection command

That's how pervasive people follow the defaults and accept what it is for almost all code. I'd far prefer some sort of solution that can keep existing cases working well while improving cases that aren't working well. On the other hand I can accept that alignment spaces were not replaced by tabs if the "keep tabs" option is activated and an autoformat is triggered. There is a bunch of options for spacing and all of them describe a concrete case where they should end in an automatic conversion of the code line.

If it isn't working, look for errors in your code, like missing brackets which stop auto format from working share|improve this answer edited Oct 28 at 9:32 answered Oct 4 '12 Reply Dain says: June 16, 2011 at 10:33 am For me on VS 2008 it was ctrl E, D to format document, and it was found under Edit>Advanced. Browse other questions tagged c# visual-studio-2010 visual-studio visual-studio-2012 visual-studio-2013 or ask your own question. Since your example appears to be a config file (XML) look at the XML editor.

Orlando December 5-9, 2016 Orlando, FL Visual Studio Live! You can change these in Tools > Options > Environment -> Keyboard (either by selecting a different "keyboard mapping scheme", or binding individual keys to the commands "Edit.FormatDocument" and "Edit.FormatSelection"). View our Privacy Policy and Terms of Use. Where can I get Visual Studio 2013?

For example. Join them; it only takes a minute: Sign up Format Code (Strg K + D) in VS 2012 up vote 1 down vote favorite 1 if I press STRG K + Ctrl+E, D formats whole document Ctrl+E, F formats selected code Note - auto formatting only works if your code successfully parses/builds. No deletion of empty lines though.