vscode text editor settings - manually configure language list - configuration

I would like to auto-close brackets for .csv files when they are open in vscode. Given the following user settings...
{
"editor.autoSurround": "languageDefined"
...
"editor.autoClosingQuotes": "languageDefined"
}
... is there a user configuration where I can add or remove language modes to apply the autoClosingQuotes setting(s) to without enabling it for all language modes?

What you want are called "language-specific settings". See using language-specific settings in vscode and documentation for same.
In your case:
"editor.autoClosingBrackets": "never",
"[plaintext]": {
"editor.autoClosingQuotes": "languageDefined"
}
You can play with those settings to achieve what you want. First I set all languages to never, and then enable it only for plaintext.
Why did I use [plaintext] above? Because in looking through the choices (Ctrl-Shift-P and search for "configure language-specific settings" there isn't a .csv choice. I assume plain text is as close as you are going to get.

Related

VSCode: turn off format on save only in specific directory

I'd like to configure VSCode to not auto-format files in a specific directory.
Background: I'm writing a library that renders json into html. For testing, I'm comparing the results with pre-rendered html snippets. Unfortunately, VSCode *cks up my formatting of the html files with it's auto-format feature. Although auto-formatting is very handy for my actual code, I'd like to turn it off for those snippets.
Is there any option to turn it off for files in a specific directory or for files matching a specific pattern in filename? If yes: Is it possible to have the settings stored in the project folder?
So far I only found the option to turn auto-formatting on/off per language. This is close but not perfect, since there are other html files in my project that would benefit from auto-formatting.
Try to add (for example, if you language is JavaScript):
"[javascript]": {
"editor.formatOnSave": true
},
"files.associations": {
"src/some-folder/*.js": "plaintext"
}

What is "overlay" in sublime text editor?

What is the "overlay" in ST and how can it be used? (please indicate default key bindings)
It's just a generic interface element which pops up a list of options and a field for searching them. Examples of overlays include the command palette (Ctrl+Shift+P) and Goto Anything (Ctrl+P).
Do you talking about command which by default binded to "ctrl+;"?
As far as i know it works like find(ctrl+f), but overlay can search for one word only.
For example we have this file:
Someone correct my english pls
If we will use find command we could look for more than one word like "my english".
But if we gonna use overlay we could to search for "my" or "english" only.
We can't search with overlay for "my engligh" cuz here is more than one word.
Sublime Text can read settings from multiple configuration files.
The default order is described here.
Packages/Default/Preferences.sublime-settings
Packages/Default/Preferences (<platform>).sublime-settings
Packages/User/Preferences.sublime-settings
<Project Settings>
Packages/<syntax>/<syntax>.sublime-settings
Packages/User/<syntax>.sublime-settings
<Buffer Specific Settings>
The latter configuration files override ("overlay") the former, allowing you to have more specific settings for certain programming language, project, etc.

How to configure Sublime text to support both spaces and tabs for indentation

I am using Sublime Text for JavaScript development where I use tabs for indentation.
But, for Python development, I need to use spaces (per PEP-8). So what config directives should I change to support both.
(I am fairly new to Sublime Text)
You can create syntax specific configurations. Preferences -> Settings - More ->Syntax Specific - User. Add the following configuration "translate_tabs_to_spaces": false, setting the boolean as appropriate.

How do I turn off COMMAND mode or VISUAL mode in Sublime?

In Sublime Text 2, if I press escape the page goes into COMMAND mode, which seems to take text input as commands, rather than actually typing the text.
Another oddity is the VISUAL mode, and I have no idea what it does besides it seems to highlight text.
I think they came installed with the theme that I got, 'soda', maybe. Anyway, I searched and found out you can turn off COMMAND mode by pressing 'i'.
Regardless, both of these modes are extremely annoying, how do I get rid of them?
By default, sublime should ignore the vintage mode package. Right down the bottom of your default settings file change
"ignored_packages": []
to
"ignored_packages": ["Vintage"]
See: http://www.sublimetext.com/docs/2/vintage.html
Note: In this case you should be able to edit the sublime default but normally you would edit your user preference file.
I knew the answer, but I'd been looking for it for a few days, so I figured I'd post it.
You have to disable the 'Vintage' package.
Go into Preferences > Package Control > Package Control: Disable Packages > Choose 'Vintage'
This happened to me. In the default preferences it was set to:
"ignored_packages": ["Vintage"]
but in my user preferences it was set to:
"ignored_packages": []
Make sure that the value is not being overridden.

default indentation in sublimetext

I use Sublime Text and want JavaScript files to use three spaces for indentaiton.
I set this in Packages/User/Preferences.sublime-settings:
{
"tab_size": 3,
"translate_tabs_to_spaces": true
}
but it has no affect and I need to manually change it for each new file.
When you have a JavaScript file open do the following:
Per-syntax Settings
Settings may be specified on a per-syntax basis. You can edit the
settings for the current syntax using the Preferences/Settings -
More/Syntax Specific - User menu.
This will allow you to set custom preferences for the current syntax. More info on indentation here: http://www.sublimetext.com/docs/2/indentation.html