VSCode Inside Curly Braces indentation - visual-studio-code

Is there a setting in VSCode in handles the indents of any content inside curly braces. I currently have my tab size set to 4. But for some reason everything inside a curly brace in javascript only has about a 2 on spacing.
Something like this:
copy(tableType) {
this.selectElementContents(document.getElementById(tableType));
},
When in reality I want something like this:
copy(tableType) {
this.selectElementContents(document.getElementById(tableType));
},
Basically a more noticeable indent so anything inside curly braces. Anyone knows of a setting that handles this?

Related

VSCode: Create two whitespaces between curly braces in CSS with cursor in the middle

Sublime had that default behaviour that in the context of a CSS file when writing { it is autocompleted to {|} (the pipe only indicates the position of the cursor and is not an actual pipe-charakter).
Upon hitting the spacebar {|} was further autocompleted to { | } (the pipe again being the cursor).
How do I get this exact behaviour in VSCode? ....and only for the context of CSS files?
I don't want snippets or any other workaround. I want, with my cursor inside of two empty curly braces, to hit the spacebar and get two spaces between the braces and the cursor to end up right in the middle.

XCode Auto-Indent moves viewModifiers 1 tab too far after a single line with a closing bracket

When I hit re-indent in my XCode project all lines that begin with a . (e.g. ViewModifiers) on a new line after a single line with only a closing bracket are moved 1 tab too far to the right.
I.e. what should indent to
Button(
// Button code
)
.accentColor(.black)
indents to
Button(
// Button code
)
.accentColor(.black)
This used to work the upper way until a few XCode-versions or so, and since then it has been the lower style.
Is there a setting or possible XCode-extension that can fix this type of alignment?
Actually for all time of SwiftUI usage never met such problem (while, yes, now I see it). I assume it is a question of code styling, cause I never used closing single )` and moreover use it at all.
The reason of sugar style of ending closures which mostly and widely used, like
Button("Button") {
// Action code
}
.accentColor(.black)
and with single } there is no such problem with auto-indentation.
So my recommendation is just change coding style to standard and forget about it.

Changing the colour of curley braces inside VSC

I write content in VSC and I use handlebars to write content.
{{#jan}} Hello my name is Tony {{else}} Hi my name is Bob {{/if}}
Is there any way I can get the content inside the {{}} to highlight something like bright yellow? when I have loads of these in the docs, its hard to spot them when scrolling.
I've tried messing around with the workspace settings.js file but have had no luck. Thanks
The title of your question asks how to change the color of the brackets themselves, while the body asks for how to change the content in the middle.
here's a solution for the title part: the extension bracket pair colorizer will give you full control over curly brace colors. by default, it colors nested braces differently, but as per its documentation, you can configure it however you want. so if you choose only one brace color, they can both be yellow or whatever color you want
https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer-2

How to auto insert spaces between double brackets (double mustache) in VS Code

Currently when I add { to a .html file, VS Code will automatically close that bracket while leaving the cursor between the brackets, same with double curly brackets. Since I am working with Angular I would like to know if it is possible to have VS Code do this:
If I add 2 open curly brackets then add 2 blank spaces between them, close the brackets and set cursor between the blank spaces.
So instead of this: {{|}} I would get {{ | }} where | represents the cursor.
"Spaces Inside Braces" seems to be the best bet currently.

Select/delete word inside brackets which inside quotes

Small question about vim mode in PhpStorm. I have this strings
if ($newGroupName) {
echo "<h3>{ $t->groupName }</h3>";
echo '<div>';
}
I want to replace $t->groupName with newGroupName, what would be the correct shortcut? All shortcuts I've tried selects both lines between if brackets.
Use ci{ which means: change what inside the curly brackets
To change all inside next bracket you can add this on your .ideavimrc file:
nmap <leader>p f)ci(
the f) is to go on next )
then change all inside with ci(
note: if nothing is on the bracket you can just type i to Insert.