-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto indent when press ENTER after colon #279
Comments
I'm not entirely sure if we have the ability to customize what happens when you just press enter in a yaml file. If you have a JSON schema attached to the file and autocomplete name then it should automatically indent underneath the "m" |
I'm curious, what's different between I press enter after name: in a yaml and press enter after def some(): in a python file, indent works well in a python file. |
From reading the docs it looks like this could be implemented using indent rules |
After re-reading the initial issue, these aren't actually all that similar. haha 😅 Nonetheless, I think I've found the commit that introduced the problem I'm experiencing: #362 I had been using 0.11.1, and installed 0.11.0. The problem still occurred. I went back to 0.10.0, and it worked as expected. The change referenced appears to have been made as part of the 0.11.0 release. |
@zlmiller I cannot reproduce your problem: Make sure that you select proper indentation( If you still has problem, please create new issue, we can discuss there. |
Hmm. Interesting. I presume the settings.json in the gif were the only ones in effect? i.e. no other level (User, Workspace, etc.) I might just have to take those as a starting point. |
|
Same request: microsoft/vscode#148528. |
for everyone still struggling here.. install the yaml extension. and then set |
I'm pretty frustrated to not have an autoindent after colon enter in YAML; my Vim plugins do this; given that some people in this thread have reported they can't reproduce it, how do we dump and identify the settings that might be causing some of us to have this issue? |
Recently Í also had this problem, but most of other extentions like Then hinted by this, I use the following config: "[yaml]": {
// "editor.defaultFormatter": "redhat.vscode-yaml", // this will format with one weird result for some yamls sometimes, so Í format manually with only the indentation format when typing.
"editor.tabSize": 2,
"editor.autoIndent": "full" // the default setting is "keep"
} It works well with the predefined foo:
bar: // this line the tab count will be added to 1 based on the past line
- bar_1 // this line the tab count will be also added
- bar_2 // this line the tab count will not be also added |
I'm trying figure out how to make vscode indent after I press ENTER after colon, like this
It should have indented and placed the cursor under the letter 'm' (2 spaces) when I pressed the enter key after "name:"
But I can't seem to get it to work. It just puts the cursor underneath the letter 'n'.
The text was updated successfully, but these errors were encountered: