Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Change VS-Code Tab setting from "Change Focus" to "Add Spaces"?

After latest VS-Code update, tab feature changes to "focus change" instead of adding space or identation. i try change every setting in setting.json but it not wotrking. it is really annoying as i am use to it. Any Help would be appreciated.

{
"workbench.iconTheme": "material-icon-theme",
"editor.formatOnSave": true,
"prettier.singleQuote": true,
"workbench.startupEditor": "newUntitledFile",
"window.zoomLevel": 0,
"indenticator.hover.peekBack": 0,
"indenticator.hover.peekForward": 1,
"indenticator.inner.hover.peekBack": 0,
"indenticator.inner.hover.peekForward": 1,
"indenticator.inner.showHighlight": true,
"html.format.endWithNewline": true,
"javascript.implicitProjectConfig.experimentalDecorators": true,
"prettier.printWidth": 110,
"html.format.indentHandlebars": true,
"html.format.indentInnerHtml": true,
"liveServer.settings.AdvanceCustomBrowserCmdLine": "C:\\Program Files\\Firefox Developer Edition\\firefox.exe",
"prettier.jsxBracketSameLine": true,
"prettier.trailingComma": "es5",
"prettier.useTabs": true,
"angular2-switcher.openSideBySide": true,
"editor.foldingStrategy": "indentation",
"editor.mouseWheelZoom": true,
"[html]": {
    "editor.defaultFormatter": "HookyQR.beautify"
},
"[less]": {
    "editor.defaultFormatter": "michelemelluso.code-beautifier"
},
"workbench.statusBar.visible": true,
"workbench.activityBar.visible": true,
"editor.renderControlCharacters": false,
"editor.showFoldingControls": "always",
"editor.smoothScrolling": true,
"breadcrumbs.enabled": false,
"terminal.integrated.rendererType": "dom",
"[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
    "editor.defaultFormatter": "HookyQR.beautify"
},
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"

}

This is my settings file. Extensions settings are same as before.

like image 781
Arslan Ameer Avatar asked Jul 07 '19 11:07

Arslan Ameer


People also ask

How do you use spaces instead of tabs in VS Code?

Click on 'Text Editor', then select 'C/C++' and open the 'Tabs' settings. Set both 'Tab size' and 'Indent size' to 4 and make sure 'Insert spaces' is selected below.

How do I change the tab setting in VS Code?

To modify user settings, you'll use the Settings editor to review and change VS Code settings. To open the Settings editor, use the following VS Code menu command: On Windows/Linux - File > Preferences > Settings. On macOS - Code > Preferences > Settings.


2 Answers

In the command palette, use Toggle Tab Key Moves Focus (Ctrl + M by default as of 1.36.0) to switch between these modes.

like image 186
tychon Avatar answered Sep 29 '22 04:09

tychon


While backing up my VS-Code settings on cloud i found (in C:\Users\[username]\AppData\Roaming\Code\User > keybindings.json) that tab was assigned as -tab labeled to move-focus. which did'nt appear on UI settings on Vs-Code. i dont know where it came from (after 2nd Last VS-Code Update):

 {
    "key": "tab",
    "command": "-tab",
    "when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus"
}

i just removed it . And it Works same as DEFAULT.

Sharing this as answer if anyone faces this problem from nowhere. Thank You. :)

like image 21
Arslan Ameer Avatar answered Sep 29 '22 03:09

Arslan Ameer