How can I disable auto new-line in Visual Studio Code?

Viewed 4288

The problem is after I've installed the Angular extension in Visual Studio Code, I constantly get across all files (.ts, .html, and .css) auto new-line after typing single letters or multiple lines of code. It's frustrating. I disabled prettier, word-wrap, and intellisense, but the problem still remains.

Is there a way I can disable it?

3 Answers

I had the same problem.

After going through my extensions, I noticed that the "EditorConfig for VS Code" extension I installed was inserting auto new-line after typing single or multiple lines of code.

If the problem is still not solved, try disabling some extensions and see if that works.

I had a similar issue and the solution provided by 9paradox solved my problem.

When I was saving my code (Python, JSON, JS, etc...) I got always a new line inserted at the end of the file.

Solution: if, e.g. on Mac, you are editing any file in your project, then go to the root directory of your project, let's say /Users/<username>/git/<project> then search for .editorconfig in that folder, then open that file with any text editor like vi or TextEdit and make insert_final_newline = false. VS Code takes over the settings changes immediately. No restart needed.

Just disable the auto save option in VSC.

Related