home scroll vscode

Visual Studio Code

Formatting

Sometimes, you may want the code to be formatted according to a different language than the file association (*.js, *.c, *.html, etc) suggests. For example, you might have HTML code in string in a javascript file and you want to auto-format that code.
settings.json:
"files.associations": {
"*.js": "html"
}
Associating several languages with the same file extension does not cause an error, but does not seem to have the desired effect
"*.js": ["html", "js"]

Useful Extensions

tool to issue GET and POST requests

Instead of using curl to test interface, can use thunder client extension in vcode.
https://marketplace.visualstudio.com/items?itemName=rangav.vscode-thunder-client

global search

https://www.reddit.com/r/vscode/comments/n4m8sn/global_search_is_only_searching_in_opened_files/ When you hit cmd+shift+f in vscode for global search, there should be 3 fields: the search field at the top, the "files to include" field in the middle, and the "files to exclude" field at the bottom. In the "files to include" field on the right side there is an open book icon. Clicking the book icon toggles between searching all files and searching only open files. Hope that helps.

Associate conda environment with source file

https://stackoverflow.com/questions/43351596/activating-anaconda-environment-in-vscode
shift + cmd + P
Search Select Interpreter
choose the desired conda environment.

Category

git Usage

Single Board Computers

Follow Me

discord