Visual Studio Code is a popular text editor or code editor to write queries and codes for developers. It is popularly known as VS code. It can highlight and format the code for quick development and understanding purposes.
visual studiocode。 Visual Studio Code是一種流行的文本編輯器或代碼編輯器,用于為開發人員編寫查詢和代碼。 它通常被稱為VS代碼。 它可以突出顯示和格式化代碼,以便快速開發和理解。
We may find several features in the VS code as a good text editor.
作為一個好的文本編輯器,我們可能會在VS代碼中找到一些功能。
Navigate to Visual Studio Code URL and choose your desired platform to install the software. You can see the installer for Windows, macOS, and Linux in the below screenshot.
導航到Visual Studio代碼URL,然后選擇所需的平臺來安裝軟件。 您可以在下面的屏幕截圖中看到Windows,macOS和Linux的安裝程序。
For Windows, you get an option to download the 32-bit or 64-bit version.
對于Windows,您可以選擇下載32位或64位版本。
Download the appropriate version and start the installation. Its installation is quick.
下載適當的版本并開始安裝。 它的安裝很快。
You can click on next for installation, but let me highlight the useful step.
您可以單擊“下一步”進行安裝,但讓我突出顯示有用的步驟。
In the setup additional tasks, you get options to integrate VS code with Windows explorer.
在設置其他任務中,您將獲得將VS代碼與Windows資源管理器集成的選項。
Launch the Visual Studio code after installation, and the default screen looks like below. On the left side, you have an activity bar.
安裝后啟動Visual Studio代碼,默認屏幕如下所示。 在左側,您有一個活動欄。
This activity bar contains the following tabs.
該活動欄包含以下選項卡。
This explorer is to open, browse, and manage the files. You can also use this as a notepad text editor or programing language code. You can open multiple files in an explorer.
該資源管理器用于打開,瀏覽和管理文件。 您也可以將其用作記事本文本編輯器或編程語言代碼。 您可以在資源管理器中打開多個文件。
You can split the files as per your requirements – Split Up, Split down, Split left, Spit right.
您可以根據需要拆分文件-拆分,拆分,向左拆分,向右吐。
For example, once you split down the files, it creates a new region for the split files. In the below screenshot, you get two files splits in the current window. It is useful when you want to compare two or more scripts together or want to reference another script.
例如,拆分文件后,它將為拆分文件創建一個新區域。 在下面的屏幕截圖中,您在當前窗口中拆分了兩個文件。 當您要將兩個或多個腳本一起比較或要引用另一個腳本時,此功能很有用。
Similarly, you can rearrange editors in multiple groups, split left, right, down in the same editor window.
同樣,您可以在同一編輯器窗口中按左,右,下拆分多個組來重新排列編輯器。
It is to search for a specific keyword in all the open files in the editor window. For example, suppose we want to replace the sys.databases with databases keyword in all open files. Enter the keyword and search it in all open editor files. You see each occurrence of the keyword in all editor files. It also shows line after keyword replacement, as highlighted below.
它是在編輯器窗口中所有打開的文件中搜索特定的關鍵字。 例如,假設我們要在所有打開的文件中將sys.databases替換為databases關鍵字。 輸入關鍵字并在所有打開的編輯器文件中搜索。 您會在所有編輯器文件中看到該關鍵字的每次出現。 它還顯示了關鍵字替換后的行,如下所示。
Visual Studio Code supports the integration of multiple Source Control providers such as TFS, Git, SVN.
Visual Studio Code支持集成多個源代碼控制提供程序,例如TFS,Git,SVN。
You can run the debugger using this tab. You can also customize the debug using a configuration file in JSON format.
您可以使用此選項卡運行調試器。 您還可以使用JSON格式的配置文件來自定義調試。
Visual Studio Code extends the functionality and features using the extensions. These extensions are free to download, install, and use. It provides various extensions for different programming languages, formats, keyboard shortcuts, cloud solutions. By default, it gives you the popular and recommended extensions. We will cover separately about the extensions in further articles.
Visual Studio Code使用擴展功能擴展了功能。 這些擴展可以免費下載,安裝和使用。 它為不同的編程語言,格式,鍵盤快捷鍵,云解決方案提供了各種擴展。 默認情況下,它為您提供了流行和推薦的擴展。 我們將在后續文章中分別介紹擴展。
Once you open a specific file in the VS code, it gives you a recommendation as well. For example, if I open a T-SQL script, it suggests installing the mssql extension for this file type.
在VS代碼中打開特定文件后,它也會為您提供建議。 例如,如果我打開一個T-SQL腳本,則建議為此文件類型安裝mssql擴展名 。
VS Code provides a code outline feature to have a high-level overview of code, quickly navigate to a particular area. It is similar to the Scroll Bars feature you get in the recent versions of SQL Server Management Studio. You can refer to New feature in SQL Server Management Studio 2016 – Scroll bar for more details.
VS Code提供了代碼概述功能,可以對代碼進行高級概述,并快速導航到特定區域。 它類似于您在SQL Server Management Studio的最新版本中獲得的“ 滾動條”功能。 您可以參考 SQL Server Management Studio 2016的新功能–滾動條 以了解更多詳細信息。
You get the minimap on the right side of the code editor. We can remove the minimap from the View-> Show minimap.
您會在代碼編輯器的右側獲得小地圖。 我們可以從“視圖”->“顯示小地圖”中刪除小地圖。
Once you open any file in VS Code, it shows its current location on the top, and you can navigate quickly between files and folders. For example, for my script, it gives me the path SQL -> QA -> script name.
在VS Code中打開任何文件后,它將在頂部顯示其當前位置,并且您可以在文件和文件夾之間快速導航。 例如,對于我的腳本,它為我提供了路徑SQL-> QA->腳本名稱。
Suppose I want to take a step back and open the script in the SQL folder. You can click on the corresponding folder, and it gives you a list of files inside the folder. Click on the respective script to open in the query editor window.
假設我想退后一步,在SQL文件夾中打開腳本。 您可以單擊相應的文件夾,它會為您提供該文件夾內文件的列表。 單擊相應的腳本以在查詢編輯器窗口中打開。
We can disable breadcrumbs using the View > Show Breadcrumbs command as shown below.
我們可以使用“ 視圖” >“ 顯示面包屑”命令禁用面包屑 ,如下所示。
You can access all functions of the VS code using the Command Palette. It shows the various tasks, configurations along with the keyboard shortcuts.
您可以使用命令面板訪問VS代碼的所有功能。 它顯示了各種任務,配置以及鍵盤快捷鍵。
You can launch a command palette from View -> Command Palette. You can also use Ctrl+Shift+P key combinations.
您可以從“視圖”->“命令面板”啟動命令面板。 您也可以使用Ctrl + Shift + P組合鍵。
It sorts the functions in alphabetical order. You can search for a specific item as well.
它按字母順序對功能進行排序。 您也可以搜索特定項目。
You can focus on your code using the zen mode in the VS code. It hides the activity bar, status bar, sidebar, and you see code in full-screen mode.
您可以在VS代碼中使用zen模式來專注于代碼。 它隱藏了活動欄,狀態欄,側邊欄,并且您可以在全屏模式下查看代碼。
To open the zen mode, search for the View: Toggle Zen Mode. Alternatively, use the keyboard shortcut Ctrl+K Z.
要打開禪宗模式,請搜索“ 視圖:切換禪宗模式”。 或者,使用鍵盤快捷鍵Ctrl + KZ。
It brings the code in full-screen mode by hiding all bars. It helps you to focus on your development work—Press Esc to exit the zen mode in VS code.
通過隱藏所有欄,它將代碼帶入全屏模式。 它可以幫助您專注于開發工作-按Esc鍵以VS代碼退出zen模式。
VS Code provides different color schemes to suit your preference and work environment. You can use the theme from the command palette. It supports different themes, as shown below.
VS Code提供不同的配色方案,以適合您的喜好和工作環境。 您可以從命令面板使用主題。 它支持不同的主題,如下所示。
Visual Studio Code provides an interactive playground to try out its features. You can launch an interactive playground from the link on the Welcome page.
Visual Studio Code提供了一個交互式游樂場來試用其功能。 您可以從“歡迎”頁面上的鏈接啟動一個交互式游樂場。
You can also launch it from the Help > Interactive Playground.
您也可以從“ 幫助” >“ 交互式游樂場”啟動它。
You can learn about the useful VS code features in this interactive playground. It gives you a list of editor features such as multi-cursor editing, intelligence, line actions, rename factoring, code folding.
您可以在此交互式游樂場中了解有用的VS代碼功能。 它為您提供了編輯器功能列表,例如多光標編輯,智能,行動作,重命名分解,代碼折疊。
For example, let’s say we want to explore Multi-cursor editing. It explains the feature and instructs to practice in this interactive window.
例如,假設我們要探索多光標編輯。 它解釋了該功能并指示在此交互式窗口中進行練習。
Similarly, scroll down, and you see the section for line actions.
同樣,向下滾動,您會看到有關行操作的部分。
For example, if we can copy a line and insert it at the above or below position using the shortcut key specified in the example. It is described well so that you can follow the steps and learn these productivity features.
例如,如果我們可以復制一行,并使用示例中指定的快捷鍵將其插入到上方或下方的位置。 對其進行了很好的描述,以便您可以按照以下步驟操作并學習這些生產力功能。
In this article, we explored the useful features of the Visual Studio Code, aka VS Code, that serves the purpose of a lightweight and powerful source code editor. You can use it on Windows, Linux, and macOS. We will explore more on its features, extensions in the upcoming articles.
在本文中,我們探討了Visual Studio Code(又名VS Code)的有用功能,該功能可用于輕量級功能強大的源代碼編輯器。 您可以在Windows,Linux和macOS上使用它。 我們將在以后的文章中進一步探討其功能和擴展。
翻譯自: https://www.sqlshack.com/getting-started-with-visual-studio-code-vs-code/
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态