19
How to create a shortcut to make spaces equal between assignments?
Ex:
$nome = "Maria Ferreira";
$telefone = "99645876";
To
$nome = "Maria Ferreira";
$telefone = "99645876";
19
How to create a shortcut to make spaces equal between assignments?
Ex:
$nome = "Maria Ferreira";
$telefone = "99645876";
To
$nome = "Maria Ferreira";
$telefone = "99645876";
24
Natively I don’t know shortcut that does this.
But I use the extension Better Align
that does just that and you can configure on the keyboard the shortcut you want. https://marketplace.visualstudio.com/items?itemName=wwm.better-align
Goes into File > Preferences > Keyboard Shortcuts
And create your shortcut like this for example:
{ "key": "ctrl+alt+i", "command": "wwm.aligncode",
"when": "editorTextFocus && !editorReadonly" }
In the link above you have the complete documentation.
Thank you, that’s right.
@Nice Herick you solved there, tmj! If you want a native shortcut that only makes a simple identation of the tags try (Ctrl+K Ctrl+F), but it only idents the tags, does not align and generates the spaces as in the ok extension.
only regarding curiosity is indicated identar this way or by some is considered bad formatting of the code ?
@luizricardo6n as far as I know it’s a matter of taste anyway. Some people find the code more "readable" when indented this way, but not that this is the rule, it may be that in your team may be a "good practice", but in the team of another company may not be used... In the Google Guide itself for example they do not indent CSS or HTML in this way... https://google.github.io/styleguide/htmlcssguide.html
Okay, thanks for clarifying.
12
To indent the code, use Alt+Shift+F.
This is the default command!
3
According to Key Bindings, in windows you use Shift + Alt + F
On the Mac is Shift + Option + F
And on Linux it’s Ctrl + Shift + i
If you want to customize, follow these steps: https://code.visualstudio.com/docs/customization/keybindings#_customizing-shortcuts
Source: https://code.visualstudio.com/docs/customization/keybindings#_Keyboard-shortcuts-Reference
0
Just to add up-to-date information:
To update the part:editorTextFocus && !editorReadonly
, you must click with the right-click on the line and choose the option:Change When Expression
orCtrl+K Ctrl+E
with the selected line.
You can also open the file keybindings.json, in the Palette of commands (Ctrl+Shift+P), search for Preferences: Open Keyboard Shortcuts (JSON), but it’s read-only.
REFERENCE:
Dude, I don’t understand what you mean by that? How does it work? It’s no use here....
-1
Visual studio 2017 (Windows) ==> Ctrl + K + D to automatically ident
The question was asked regarding Visual Studio Code and not Visual Studio
-2
Commands may change depending on the version of vscode; logo, to know the command, access File > Preferences > Keyboard Shortcuts and consult. If this does not work, try indenting with this command: Ctrl + [
Browser other questions tagged visual-studio-code
You are not signed in. Login or sign up in order to post.
And in Visual Studio?
– CypherPotato
List of Visual Code shortcuts: Window, Linux and Macos
– Augusto Vasques