What about editor vs

May 23, 2019 am 09:26 AM
vscode

What about editor vs

VScode is a lightweight editor launched by Microsoft. Its functions are similar to Atom, Sublime Text, and Vim. It can be configured into a suitable IDE.

1. Software download and installation

VScode download address: https://code.visualstudio.com/

VScode’s github project address (not used in this article to): https://github.com/microsoft/vscode

Python download address: https://www.python.org/downloads/

The author uses the win version of VScode1 .0 and 32-bit Python2.7. When installing Python, be sure to add Python to the system environment variable

2. Introduction to the VScode project structure

VScode uses projects named by folders, that is If you want to write a program, you need to create a new folder as your project. This folder contains your source files. If you need to run it, you also need to create a new .vscode folder under this folder and configure it under the .vscode folder. How this project works.

The following is a typical project structure

├─Project name

│ │ Source file 1

│ │ Source file 2

│ │ ……

│ │ Source file n

│ │

│ └─.vscode

│ │ Tasks.json

│ Settings.json

This time there are more configuration pits, vSCODE recommends changing the region to EN-US, otherwise, some ordered you must play Chinese, do not play English, Chinese show English results, play English in English, English in English, English in English, English in English, English in English, English in English, English in English, English in English, English in English, English in English, English in English, English in English, English in English, English in English, English in English, English in English, English in English, English in English, English in English, English in English, English in English, English in English. no result.

Of course, this article has not changed the region

3. Install the Python plug-in

Installing the Python plug-in can realize some functions of syntax prompts. It is recommended to install it.

Open VScode, view -->Command Panel (Ctrl Shit P), enter ext install (Chinese input: extension, then select extension: install extension), select Python in the search results that appear, and click The little cloud on the right is ready for installation.

4. Create a new project and edit source code

To create a new project is to create a new folder. The author first creates a new PythonProject01 folder on the D drive (this step is built in the system, not in VScode ), click the Resource Manager button in VScode, click the blue open folder button

Find the newly created folder on the D drive, and click to select the folder

Click the button to create a new file and fill in the file name hello.py

Enter the following code in the editing window on the right and save it

# -*- coding: UTF-8 -* -

print "Hello, World!"

print "Hello, World!"

5. Edit the task.json task file and run the program

View-->Command Panel (Ctrl Shit P), enter Tasks: Configure Task Runner (Chinese input: task, then select Task: Configure Task Runner), select Other

At this time VScode will automatically Generate the .vscode folder and generate a default task.json

Change the task.json content to the following and save it

{

// See http:// go.microsoft.com/fwlink/?LinkId=733558

// for the documentation about the tasks.json format

"version": "0.1.0",

"command":"python",

//"command":"D:\\Python27\\python.exe",

"isShellCommand": true,

//"args": ["${file}"], //This way of writing cannot be compiled

"args": ["hello.py"],

"showOutput ": "always"

}

The running method is as follows:

View-->Command Panel (Ctrl Shit P), enter Tasks: Run Build Task (Chinese input :Task, and then select the task: Run the build task (Ctrl Shit B))

The results are as follows:

Attachment: Change the language to en-US

Ctrl Shit P, Enter the language (Language), select the configuration language (Configure Language), the location.json file will automatically appear

Add "locale":"en-US" as shown below, save it

{

// Define the display language of VSCode.

// See http://go.microsoft.com/fwlink/?LinkId=761051 for a list of supported languages.

// To change the value you need to restart VSCode.

"locale":"en-US"

}

Just restart VScode.

If you want to change back to Chinese, change it to "locale":"zh-CN" or delete the location.json file.

The above is the detailed content of What about editor vs. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to define header files for vscode How to define header files for vscode Apr 15, 2025 pm 09:09 PM

How to define header files using Visual Studio Code? Create a header file and declare symbols in the header file using the .h or .hpp suffix name (such as classes, functions, variables) Compile the program using the #include directive to include the header file in the source file. The header file will be included and the declared symbols are available.

What computer configuration is required for vscode What computer configuration is required for vscode Apr 15, 2025 pm 09:48 PM

VS Code system requirements: Operating system: Windows 10 and above, macOS 10.12 and above, Linux distribution processor: minimum 1.6 GHz, recommended 2.0 GHz and above memory: minimum 512 MB, recommended 4 GB and above storage space: minimum 250 MB, recommended 1 GB and above other requirements: stable network connection, Xorg/Wayland (Linux)

vscode terminal usage tutorial vscode terminal usage tutorial Apr 15, 2025 pm 10:09 PM

vscode built-in terminal is a development tool that allows running commands and scripts within the editor to simplify the development process. How to use vscode terminal: Open the terminal with the shortcut key (Ctrl/Cmd). Enter a command or run the script. Use hotkeys (such as Ctrl L to clear the terminal). Change the working directory (such as the cd command). Advanced features include debug mode, automatic code snippet completion, and interactive command history.

Where to write code in vscode Where to write code in vscode Apr 15, 2025 pm 09:54 PM

Writing code in Visual Studio Code (VSCode) is simple and easy to use. Just install VSCode, create a project, select a language, create a file, write code, save and run it. The advantages of VSCode include cross-platform, free and open source, powerful features, rich extensions, and lightweight and fast.

How to solve the problem of vscode Chinese annotations becoming question marks How to solve the problem of vscode Chinese annotations becoming question marks Apr 15, 2025 pm 11:36 PM

How to solve the problem that Chinese comments in Visual Studio Code become question marks: Check the file encoding and make sure it is "UTF-8 without BOM". Change the font to a font that supports Chinese characters, such as "Song Style" or "Microsoft Yahei". Reinstall the font. Enable Unicode support. Upgrade VSCode, restart the computer, and recreate the source file.

Common commands for vscode terminal Common commands for vscode terminal Apr 15, 2025 pm 10:06 PM

Common commands for VS Code terminals include: Clear the terminal screen (clear), list the current directory file (ls), change the current working directory (cd), print the current working directory path (pwd), create a new directory (mkdir), delete empty directory (rmdir), create a new file (touch) delete a file or directory (rm), copy a file or directory (cp), move or rename a file or directory (mv) display file content (cat) view file content and scroll (less) view file content only scroll down (more) display the first few lines of the file (head)

vscode terminal command cannot be used vscode terminal command cannot be used Apr 15, 2025 pm 10:03 PM

Causes and solutions for the VS Code terminal commands not available: The necessary tools are not installed (Windows: WSL; macOS: Xcode command line tools) Path configuration is wrong (add executable files to PATH environment variables) Permission issues (run VS Code as administrator) Firewall or proxy restrictions (check settings, unrestrictions) Terminal settings are incorrect (enable use of external terminals) VS Code installation is corrupt (reinstall or update) Terminal configuration is incompatible (try different terminal types or commands) Specific environment variables are missing (set necessary environment variables)

vscode Previous Next Shortcut Key vscode Previous Next Shortcut Key Apr 15, 2025 pm 10:51 PM

VS Code One-step/Next step shortcut key usage: One-step (backward): Windows/Linux: Ctrl ←; macOS: Cmd ←Next step (forward): Windows/Linux: Ctrl →; macOS: Cmd →

See all articles