I don't want to enable all the times, it's sometimes annoying.
First disable the hover for all languages and then enable it for specific languages, in your settings.json like this:
"editor.hover.enabled": false,
"[scss]": {
"editor.hover.enabled": true
}
You can put multiple languages in the specific setting like:
"[scss, css]": {
"editor.hover.enabled": true
}
Related
I have a Vue project. When I go into my VS Code settings, I see an extension called "Vetur". I believe Vetur is what takes care of all code formatting for me. Under settings, when I click into Vetur, it gives me a list of different formatters for JS, CSS, HTML, etc. as they appear within Vue files. Here's a picture:
Picture of Vetur settings
The default formatter set for most things is something called prettier.
However, when I go into settings (which takes me to a file called settings.json), I don't see the word "prettier" there at all! Instead, I see a bunch of settings for other formatters that weren't selected (such as js-beautify-html), and the closest thing to the word "prettier" is the word "prettyhtml".
In the dropdown list for HTML, I do see an option for "prettyhtml", but it warns me that it's deprecated. Here's a screenshot: prettyhtml shown as a dropdown option but says it's deprecated.
When I go into this settings.json, I see this part:
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "force-expand-multiline"
},
"prettyhtml": {
"printWidth": 100,
"singleQuote": false,
"wrapAttributes": false,
"sortAttributes": false
}
}
Is "prettyhtml" the same thing as "prettier"?
If not, then why doesn't anything appear in settings.json for "prettier"? There are exactly zero string matches for the word "prettier" in settings.json.
This is all very confusing! Thanks.
Is it possible to have background color changed in visual studio code but only for few programmatic tokens like classes and strings in Java and Python.
I'm able to change color but not background color for a particular theme.
"editor.semanticTokenColorCustomizations": {
"[Monokai Dimmed]": {
"enabled": true,
"rules": {
"module": "#943535",
"class": {"foreground": "#943535", "bold": true}
}
}
},
Maybe this is more like a function of highlight? This way you can install some extensions of that type.
Besides, during your code, I still remember some settings in official document.
In the part of Editor syntax highlighting, there are something like:
"editor.tokenColorCustomizations"
It can tune the editor's syntax highlighting colors('comments', 'strings', ...).
But I'm not sure this is what you want. You can see this for more information. Hope helpful.
enter link description here
I want a single key binding to perform 2+ actions. Is this possible?
I tried doing it the obvious way (by setting two shortcuts to use the same key binding), but it appears to only respect the most recently changed shortcut.
The awesome macros plugin might be the best option.
As an example, let's say you want cmd+\ to hide both the Activity Bar and the Sidebar.
Add the following to your user settings:
"macros": {
"minimalMode": [
"workbench.action.toggleActivityBarVisibility",
"workbench.action.toggleSidebarVisibility"
]
},
Add the following to your keybindings.json:
{
"key": "cmd+\\",
"command": "macros.minimalMode"
},
I want to disable word based suggestion, it's annoying and useless in my opinion. For example Brackets will offer suggestion for variables, methods and language and will not pollute the suggestion list with all similar words written in file.
I just want code suggestion. I tried "editor.wordBasedSuggestions": false, but no luck. How to change that ? Thanks.
Example:
Try adding:
"javascript.nameSuggestions": false
// Controls if suggestions should be accepted 'Enter' - in addition to 'Tab'. Helps to avoid ambiguity between inserting new lines or accepting suggestions.
"editor.acceptSuggestionOnEnter": "off"
from here
You can use this setting:
"editor.wordBasedSuggestions": false
You can use this one as I had problems with javascript function snippet not being on top
"editor.suggest.filteredTypes": {
"keyword": false
},
In UI it's:
Edit -> Perferences -> Settings -> Text Editor -> Suggestions -> Javascript > Suggest: Names
Can you please tell me how to remove below message on VS code editor?
The attribute name of [ *ngIf ] must be in lowercase.
Above message shows on below code
<div *ngIf="isBornOn">
</div>
I think it has to do with the vscode-htmlhint plugin, try disable it.
If that removed the warning you can disable just that rule by setting attr-lowercase to false.
Read more about the configuration of this plugin here
In VSCode you can set the following settings to disable it.:
"htmlhint.options": {
"attr-lowercase": false
}
If don't want lose warning when use attributes that don't follow lower case rule. Instead of, you can define an attribute white list:
"htmlhint.options": {
"attr-lowercase": [
"*ngIf",
"ngIf",
"*ngFor",
"ngFor",
"ngSwitch",
"ngModel"
],
"doctype-first": false
},
Also can add doctype-first to avoid that message on every component.
Anyone looking to solve this from another IDE such as Eclipse or Codemix, simply create a file called .htmlhintrc place this in /<angular-project>/src/.htmlhintrc
and change the values as you see fit, mine are:
{
"tagname-lowercase": false,
"attr-lowercase": false,
"attr-value-double-quotes": true,
"doctype-first": false,
"tag-pair": true,
"spec-char-escape": true,
"id-unique": true,
"src-not-empty": true,
"attr-no-duplication": true,
"title-require": true
}
Re-open the tab if not automatically resolved or then restart the IDE.
Under VS Code - Extensions (left sidebar - box-shaped icon) - Disable this plugin or uninstall if required.
Then Reboot