Use Journals for your notes and blogging!

Software Development

A journal for sharing all things software development related


Tabs .vs spaces

Tue, 17 Dec 2019 14:14 UTC by garethbrown

.editorconfig

Use .editorconfig extension and then create .editorconfig file in project root with

root = true

[*.{json,js,ts,tsx,html,css,less,md,twig,vue}]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf

So you can create .editorconfig for separate folders or setup by file extension (just remove that root = true to allow merging config from parent folder)

this will override your editor config / any modern IDE settings and then, AUTO-REFORMAT CODE :) (Ctrl+Shift+P and search for Format document)

it will reformat your code and replace tabs -> spaces or what you will setup

it is not automatic, i know ... just assign key shortcut for code reformat

(Source: https://www.reddit.com/r/vscode/comments/cnqk62/how_to_have_vscode_automatically_convert_tabs_to/)

Displaying in Visual Studio

You can display or hide whitespace characters in VS with the following keyboard shortcut

    C-r, C-w

https://stackoverflow.com/questions/6255839/show-space-tab-crlf-characters-in-editor-of-visual-studio


The information on this site is provided “AS IS” and without warranties of any kind either express or implied. To the fullest extent permissible pursuant to applicable laws, the author disclaims all warranties, express or implied, including, but not limited to, implied warranties of merchantability, non-infringement and suitability for a particular purpose.


Software development notes and articles

Email garethbrown: mail@appsoftware.com

UI block loader
One moment please ...