简体   繁体   中英

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

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?

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.

Take a look at this: Visual Studio Code — Insert New Line at the End of Files

It is a post about including the new line, but following the steps you will find how to prevent it.

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, eg 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM