Treating spaces as tabs in VS Code - visual-studio-code

I started working VS Code at work and at home recently, and have run into a weird issue; I'm not sure if it's a setting I can't find or a bug, so thought I'd ask.
I have VS code setup (in both environments) to indent 4 spaces on tab, however, on my work computer, when I navigate over the 4-space-tabs, the IDE advances the full 4 spaces, treating it like a tab but using 4 spaces. On my laptop, I have to advance space by space, and it's pretty annoying. I have the same extensions on both, none of which affect spaces as far as I know.
Any advice?

Look into this setting on both of your work and laptop computers

Related

VS Code indenting substituting spaces for tabs?

I am developing in Python via remote-SSH in VS-Code. After a particularly hasty shutdown due to physical issues with the remote server where I commanded a shutdown from within the terminal, I came back to VS-Code to discover that all of the formatting in my remote workspace was entirely screwed up.
Specifically, pressing Tab to indent would invariably give four spaces despite indicating "Indent Using Tabs" with size 4, in both the User and Remote settings tabs. What's even more confusing is that when I insert a newline, tabs are substituted by spaces, i.e. if I am entering a new-line on a twice-indented line, the next line is indented by two spaces instead of two tabs, etc.
VS Code substitutes a space for a tab
I am not running many extensions, just all the Microsoft Python extensions, as well as IntelliCode. I am not running Prettier.
Attempts to fix it include various combinations and permutations of forcing the entire document to indent using tabs, converting all the spaces to tabs, and converting all of the tabs to spaces in some vague hope of resetting whatever widget is broken within VS-Code, none of which have had any effect.
If anyone has encountered this before or knows exactly what is causing this issue, I would be extremely grateful.
Solved. For some reason Python Indent was installed in my local extensions, and it was auto-correcting the indents. Closing the issue in 2 days

Change size of whitespace tab arrow character in VS Code

I am currently setting up VS Code on a new computer and want to maintain all the same configuration, addons etc that I had on my previous computer. I was able to copy all of the settings, fonts, themes I like, etc; however for some reason I can't figure out how to change the size of the Tab arrow character for whitespace.
In my old editor, the Tab arrow spanned two spaces, whereas on my new computer, the tab arrow only spans one space.
I've been looking all over, and tried googling any variation of "change tab character size", "modify tab arrow span" etc that I could think of. I seem to remember changing the arrow size at some years ago, which is how I got it in my old editor, but I've totally forgotten, and can't find the setting anywhere, neither searching in the VS Code settings, nor on google like I mentioned; the only things that turn up are for changing tab indent size from 2, to 4 spaces etc.
Here are some screenshots of what I mean, from the new VS Code editor and from the one on my older computer:
Current tab arrow size in VS Code:
Old tab arrows size (what I want in my new editor):
This is driving me crazy, and I'm sure it's a simple setting somewhere that I'm missing. Any help would be appreciated!
Edit: In case it is relevant, I'm using JetBrains Mono as my font, and its the same version of the font as from my old computer as well, I copied it over and installed it on the new PC.
To my shock, the issue resolved itself after rebooting my PC. Once again it would seem that the tried and true "have you tried turning it off and on again" continues to ring true in many cases.
The only explanation I can think of is that perhaps some of the font symbols for whitespace characters weren't fully updated for some reason after installing the JetBrains Mono font, which I had installed earlier the same day, and after rebooting my PC I guess all the characters were fully updated/refreshed, and now the longer arrow is displayed for the tabs; I guess this also means that there is no arrow resizing per se, and the arrow symbol for the tab is simply the font symbol.
In any case, I figured I should write this update as an answer in case something like this happens to anyone else in the future.

VSCode editor on macos. Strange behaviour of the multiline selected block

Some time ago I've got a problem with Editor. I select multiple lines (with option-command-<up/down>) and trying to add multiple spaces to shift the whole block to the right. But editor adds tons of extra spaces. Please see screens attached.
Can anyone please help me to bring this to normal state?
Problem has been appeared recently (few days maybe).
VSCode version: 1.46.1
Found it. It was "editor.multiCursorMergeOverlapping". Setting it to true brings the behaviour to default.

Is it possible to seperate tab and indentation configuration in Visual Studio Code?

I'm trying to configure Visual Studio Code to treat tab characters in files as being 8 spaces but have indentation (when I hit tab on the keyboard) as being 4 spaces. Is this at all possible?
I can achieve this in eclipse with the code style formatter but can't achieve the same thing in VS Code.
(I've submitted an issue to the VS Code repository on git hub now https://github.com/Microsoft/vscode/issues/42643)
You need to modify your user settings (or workspace settings) in VS Code. By default, it is set a tab as 4 spaces.
You can modify the setting "editor.tabSize": 4, and set that to 8.
However, also be aware that "editor.detectIndentation": true, is set to try by default and this causes VS Code to detect the indication size of the file you open. So if the file itself has spacing set to say 4 or even 2, then VS Code will auto set spaces to that value while that file is open...or until you convert indentation.
You can convert indentation via the command palette and that should update the spacing to your desired setting.
As far as I've seen, No.
It appears that VS code still can't separate the two concepts of tab size and indentation distance. Some suggestions, ideas and hopeful soulmates of ours can be found in this issue on github: https://github.com/Microsoft/vscode/issues/5394#issuecomment-215414643
I agree with the comments in that issue in that separating the tab size from the indentation distance is a nice feature that solves several problems. The only thing needed is for someone to actually do the work to implement that in vs code.
Or, a less intrusive route, I have actually been thinking about creating an extension to override the indentation action in some way and use a custom settings variable for the indentation distance there... but I have yet to learn enough about the internals of VS code to determine if that's even possible for an extension to do.

Tab vs Space indenting (Dreamweaver vs NetBeans) problem

I use Dreamweaver at work and NetBeans IDE at home, but in both cases project is stored at github. My problem is that NetBeans seems to be constructing code indenting out of spaces and when opened in dreamweaver or exported to github, indenting here and there breaks (moves unexpectedly further then it was intended or vice versa), although when opened again in NetBeans, goes back to normal. It has been pain for some time already. Is there any resolution to this?
I should say that we at work (and me including) prefer tab indenting.
It depends on the IDE's definition of a TAB. There are usually options within the IDE to indent using a TAB but turn the TAB into a given number of SPACES. I usually indent using TAB but have the IDE turn that into 3 SPACES. This means that it doesn't matter what I (or anyone else) use to read my code later the indets are always the same.
In NetBeans you need to look in the Code Editor options but I have no idea where to find the settings in Dreamweaver.
Its been known that one should use double space rather than tab, because that fact that different IDEs define how the tab button works DIFFERENTLY.
For example, emberjs team require contributor to use double-space rather than tab for formatting the code.
It make sense that to use something recognized in common without an IDE, so that the code structure will not be a problem in a highly collaborated coding team environment.
HOWEVER, if customization of how a tab works in an IDE is enabled, tab will be a great time saver in this case-- Press twice the button cost 200% of the time to press one obviously :)
Hope that helps!