How can I get rid of visual studio code's auto formatting? - visual-studio-code

How can I block visual studio code from auto formatting on save?
It causes chaos to the git commit!
The blanks which are auto generated by this software, which have nothing to do with the function improvements, are messed up with the real useful code.
How can I get rid of this auto formatting?

Go to Settings and search 'format'. There's an option there called "Editor: Format On Save". Turn this off, and it should disable the auto-formatting.

Related

Is there Partial Formatting for Flutter&Dart in Visual Studio Code?

I tend to CTRL+S my code quite often so Dart SDK formatter automatically formats the .dart file completely, from top to bottom. I know it is easy to turn this off by simply going to settings.json file of VSCode and adding "editor.formatOnSave": false,
When using Android Studio, I tend to turn this feature off and do partial formatting where I choose which part of the code I want formatted and hit the keys, telling IDE to format it which isCTRL+ALT+L by default.
Now I wonder if I can do partial formatting in Visual Studio Code. I don't want to auto-format my dart code and I don't want to format the whole dart file in VS Code, what do I do, can I do it?
No, there is no partial formatting as of right now.

Why is my Dart code auto-moved to a different line, when I Ctrl+S?

What happened is that when I move my codes to different lines, and when I CTRL+S, the code automatically get moved to a different line.
What setting in VS Code is this?
That's because you have format on save.
You need to go to VS Code settings and search formatOnSave and turn it off
check if the "auto format on save" option is on: VSCode: How do you autoformat on save?
you can also go into the dart plugin's preferences in vscode and change the line length at which formatting the code will auto-wrap it. You can make it however long you want. Just go into settings and search "Dart: Line Length"
For me, I went to the dart extension setting, there is an option of Dart: Enable SDK Formatter. It should be the problem I guess because when I disabled it, everything started working fine.
We can directly search for Dart: Enable SDK Formatter in VS Code settings.

Is there a way to disable auto-indenting only on comments in VS Code?

I want to keep my formatting settings, but have them not affect comments in my code. Can I apply such a setting in Visual Studio Code?

How to turn off copy with syntax highlighting?

In Visual Studio Code version 1.10 Copy with syntax highlighting has been introduced.
I don't want to use it most of the time but I can't find a way to turn it off.
Even though I have no keybinding set for editor.action.clipboardCopyWithSyntaxHighlightingAction VSCode always copies with Syntax highlighting.
How can I turn it off so that I copy plain text only?
Go to settings.json file and add
"editor.copyWithSyntaxHighlighting":false
https://github.com/microsoft/vscode/issues/20837
Using Visual Studio 2019, go to Tools/Options/Text Editor/Advanced then 'Copy rich text on copy/cut' to save color when cutting code from VS and pasting into Word.

sublime text-like code scrollbar on visual studio code

I have recently switched from Sublime Text to Visual studio code, but there is something that i truly miss, and it is the scroll bar at the top right corner of the which shows a smaller version of the file being edited (I don't know the exact name).
I find it pretty useful to navigate through my files, especially when i want to start deleting blocks of code i have commented out, before i submit my code.
Is there any plugin to get this on visual studio code, or is there any ongoing plans in order to implement it? Thanks!
Tracked in this feature request: https://github.com/Microsoft/vscode/issues/4865