vscode guide to the north

vscode guide to the north

VSCode (full name Visual Studio Code) is a free and open source cross-platform integrated development environment (IDE) developed by Microsoft. It supports a variety of programming languages, including JavaScript, TypeScript, Python, Java, etc., and provides powerful code editing, debugging, version control, auto-completion and other functions, which can help developers write code more efficiently.

The advantage of VSCode is that it is lightweight and highly scalable. Its functions can be extended through plug-ins, and the number of official and community plug-ins is very rich, which can meet the needs of different developers. In addition, it also supports integration with version control systems such as Git to facilitate developers to manage code.

Overall, VSCode is a powerful and easy-to-use IDE, especially suitable for front-end development and lightweight back-end developers.

How to configure the extension path of vscode

If you want to change the directory of the VSCode extension, you can configure it as follows:

  1. Open VSCode and enter "User Settings" (File > Preferences > Settings), or use the shortcut key (Ctrl + ,) directly.

  2. Enter "extensions" in the "Search settings" box to find the "Extensions: Install Extensions to" setting.

  3. By default, this setting is empty, that is, all extensions will be installed in the default extension directory of VSCode. If you want to change the extension directory, enter a new path here.

  4. Enter the new path in the input box, for example: C:\MyExtensions. Make sure this directory already exists.

  5. Close and reopen VSCode and select Extensions. You can see that all installed extensions have been moved to the new directory.

Note: If you want to share this extensions directory, for example using the same extensions directory on multiple systems, you need to ensure that this directory is accessible to all users, or you can set this directory in your user folder.

Default path to vscode configuration file

The default path to the VS Code configuration file varies based on different operating systems:

  • Windows: %APPDATA%\Code\User\settings.json
  • macOS: $HOME/Library/Application Support/Code/User/settings.json
  • Linux: $HOME/.vscode/settings.json

Among them, settings.jsonis the configuration file of VS Code, where you can set common configuration options, such as themes, fonts, encoding, etc. Note that in Windows systems, %APPDATA%it is an environment variable that points to the path of the current user's application data folder.

There are multiple indexes when programming in C++, but they are not pointed correctly

The constructed index location is:${HOME}/.cache/vscode-cpptools

  1. Close vscode
  2. Delete the index database:rm -rfv ${HOME}/.cache/vscode-cpptools/*
  3. Reopen vscode

There is nothing better than reading the official documentation: https://code.visualstudio.com/docs/cpp/faq-cpp

How to add local and remote SSH paths at the same time in the VSCode workspace

https://code.visualstudio.com/docs/editor/workspaces

Refer to the official documentation and modify the code-workspace file independently.

First open an SSH link, select save workspace as from the File menu, then select show local, and save it locally.
Open the workspace configuration file and add the following information to the folders entry (Json format)

"folders": [
{
    
    
    "path": "D:/.../"
},

pythonRun debug launchprofile

{
    
    
    "version": "0.2.0",
    "configurations": [
        {
    
    
            "python": "/home/zdliu/anaconda3/envs/py37/bin/python3",  # 指定python解释器
            "name": "Python: train",
            "type": "python",
            "request": "launch",
            "program": "/home/axjia/train.py",
            "console": "integratedTerminal",
            "env": {
    
    "CUDA_VISIBLE_DEVICES":"0,1"},   # 指定显卡
            "args": ["--train_dir", "./input/train_data",   # 命令行参数
                "--dev_dir", "./input/valid_data",
 
            ],
            "justMyCode": false   # 调试封装包里面的代码,可以在里面打断点
        }
    ]
}

Precautions

Do not use the terminal to delete files directly in VSCode! This cannot be restored!

reference

@misc{BibEntry2023May,
title = { {C/C++ extension FAQ}},
year = {2023},
month = may,
note = {[Online; accessed 29. May 2023]},
url = {https://code.visualstudio.com/docs/cpp/faq-cpp}
}
@misc{BibEntry2023Jun,
title = { {ZXYFrank - 博客园}},
year = {2023},
month = jun,
urldate = {2023-06-25},
language = {chinese},
note = {[Online; accessed 25. Jun. 2023]},
url = {https://www.cnblogs.com/zxyfrank}
}

Guess you like

Origin blog.csdn.net/orDream/article/details/130927249