自訂 IDECustomizing the IDE

Visual Studio for Mac 可以自訂,讓使用者能夠在符合其需求的環境中開發應用程式,以達到效率和美學。Visual Studio for Mac can be customized, allowing users to develop apps in an environment that meets their needs for both efficiency and aesthetics. 本文章探討 Visual Studio for Mac 可調整以符合您需求的各種方式。This article explores the variety of ways that Visual Studio for Mac can be adapted to suit your needs.

深色佈景主題Dark theme

暗色調佈景主題檢視

您可以瀏覽至 [Visual Studio] > [喜好設定] > [環境] > [視覺化樣式],然後從 [使用者介面佈景主題] 下拉式清單中選取所需的佈景主題,以在 Visual Studio for Mac 中切換佈景主題,如下圖中所示:You can switch themes in Visual Studio for Mac by browsing to Visual Studio > Preferences > Environment > Visual Style and selecting your desired theme from the User Interface Theme drop-down, as illustrated in the following image:

暗色調佈景主題選取

當地語系化Localization

Visual Studio for Mac 以下列 14 種語言進行當地語系化,使它可供更多開發人員存取:Visual Studio for Mac is localized in the following 14 languages, enabling it to be accessible to more developers:

  • 簡體中文 - 中國Chinese - China
  • 繁體中文 - 台灣Chinese - Taiwan
  • 捷克文Czech
  • 法文French
  • 德文German
  • 英文English
  • 義大利文Italian
  • 日文Japanese
  • 韓文Korean
  • 波蘭文Polish
  • 葡萄牙文 - 巴西Portuguese - Brazil
  • 俄文Russian
  • 西班牙文Spanish
  • 土耳其文Turkish

若要變更 Visual Studio for Mac 所顯示的語言,請瀏覽至 [Visual Studio] > [喜好設定] > [環境] > [視覺化樣式],然後從 [使用者介面語言] 下拉式清單中選取所需語言,如下圖所示:To change the language displayed by Visual Studio for Mac, browse to Visual Studio > Preferences > Environment > Visual Style and select your desired language from the User Interface Language drop-down, as illustrated in the following image:

語言選擇

作者資訊Author information

作者資訊面板可讓您新增自己的相關資訊,例如姓名、電子郵件地址、作品的版權擁有者、公司及商標:The author information panel allows you to add relevant information about yourself such as your name, email address, the copyright owner for your work, your company, and trademark:

編輯作者資訊區段

這項資訊用來填入標準檔案標題 (例如授權),您可能會將這些標題加入新檔案:This information is used to populate standard file headers, such as a license, that you might add to new files:

標準標題選項

填入的 [名稱] 和 [電子郵件] 欄位將在透過 Visual Studio for Mac 中的版本控制進行的任何認可中使用。Populated Name and Email fields will be used in any commit that is made through Version Control in Visual Studio for Mac. 如果您尚未填入這些欄位,Visual Studio for Mac 會在您嘗試使用版本控制時提示您這樣做。If you haven't populated these fields, Visual Studio for Mac will prompt you to do so when you try to use Version Control.

按鍵繫結關係Key bindings

按鍵系結或鍵盤快速鍵可讓您調整您的開發環境,讓您可以在 Visual Studio for Mac 之間更有效率地移動。Key bindings, or keyboard shortcuts, allow you to adapt your development environment so that you can move more efficiently throughout Visual Studio for Mac. 它提供許多熱門 IDE 的常見按鍵繫結,例如 Visual Studio (在 Windows 上)、ReSharper、Visual Studio Code 和 Xcode。It provides familiar key bindings for many popular IDEs, such as Visual Studio (on Windows), ReSharper, Visual Studio Code, and Xcode.

您可以瀏覽至 [Visual Studio] > [喜好設定] > [環境] > [按鍵繫結] 來設定按鍵繫結,如下圖所示:Key bindings can be set by browsing to Visual Studio > Preferences > Environment > Key Bindings , as illustrated by the following image:

設定按鍵繫結

從這裡您可以搜尋按鍵繫結組合、檢視衝突的繫結、新增繫結和編輯現有的繫結。From here you can search for key binding combinations, view conflicting bindings, add new bindings, and edit the existing bindings.

您也可以在 Visual Studio for Mac 的初始安裝期間,透過 鍵盤選取 畫面來設定這些系結:These bindings can also be set during the initial setup of Visual Studio for Mac, via the Keyboard Selection screen:

設定金鑰系結,第一次執行

工作區版面配置Workspace layout

Visual Studio for Mac 的工作區是由一個主要檔區域所組成 (通常是編輯器、設計工具介面或選項檔) ,並包含可存取和管理應用程式檔、測試和偵錯工具的實用資訊,包含有用的 工具視窗Visual Studio for Mac's workspace consists of a main document area (normally the editor, designer surface, or options file), surrounded by complimentary tool windows that contain useful information for accessing and managing application files, testing, and debugging.

工作區版面配置

查看和排列工具視窗Viewing and arranging tool windows

當您在 Visual Studio for Mac 中開啟任何新的方案或檔案時,應該會注意到工作區中的一些 工具視窗 ,包括 [方案] 視窗、[檔大綱] 和 [錯誤]:When you open any new solution or file in Visual Studio for Mac, you should notice some tool windows in the workspace, including the Solution Window, Document Outline, and Errors:

工具視窗

Visual Studio for Mac 提供包含其他資訊、工具和導覽輔助工具的工具視窗,您可以流覽 [ View ] 功能表項目並選取要加入的工具視窗,以存取這些工具視窗:Visual Studio for Mac provides tool windows containing additional information, tools, and navigation aids, all of which can be accessed by browsing the View menu item and selecting a tool window to add it:

選取新的工具視窗

不同的命令也可以自動開啟工具視窗,例如 [在檔案 中尋找 ] (Shift + Cmd + F) 命令,這會開啟已卸離的搜尋結果視窗。Tool Windows may also be opened automatically by various commands, such as the Find in Files (Shift + Cmd + F) command, which opens a detached window of search results.

您可以透過任何最適合您的方式,在整個工作流程中移動和排列工具視窗。Tool Windows can be moved and arranged throughout your workflow in whatever way is most useful to you. 例如,它們可以停駐在檔編輯器的任何一邊、與其他工具視窗相鄰、位於另一個視窗的上方或下方,或作為一組索引標籤式視窗,讓您快速切換它們。For example, they can be docked on any side of the document editor, adjacent to another tool window, above or below another window, or as a set of tabbed windows enabling you to quickly switch between them.

針對常用的工具視窗,您也可以將它們從 Visual Studio for Mac 視窗和各自的新視窗中完全卸離。For frequently used tool windows, you can also completely detach them from the Visual Studio for Mac window and into their own new window.

您可以透過每個視窗右上角的控制項來釘選和關閉工具視窗:Tool Windows can be pinned and closed by the controls in the top-right corner of each window:

使用控制項釘選或關閉工具視窗

固定的視窗會停駐在工作區的側邊,並在您需要時保持開啟,以加快存取的速度。Pinned windows are docked to the sides of the workspace and remain open for quicker access when you need them. 停用的視窗是固定的,但在您將滑鼠停留在視窗的索引標籤上,並將滑鼠或焦點放在鍵盤上時,才會顯示:當滑鼠和鍵盤焦點離開它們時,就可以隱藏它們。Unpinned windows are docked, but not shown until you hover over the tab for the window with a mouse or focus with the keyboard; they can be hidden when the mouse and keyboard focus leaves them.

組織版面配置Organizing layouts

在任何時間顯示的工具視窗都取決於目前的內容。The tool windows that are displayed at any time are dependent on the current context. 例如,使用視覺化設計工具時,[工具箱] 和 [屬性方格] 視窗最重要;在進行偵錯工具時,讓偵錯工具視窗能夠用來查看堆疊和區域變數會很有用。For example, when using the visual designer, the toolbox and property grid windows are most important; when debugging, it is useful to have the debugger windows for viewing the stack and locals.

開啟的工具視窗狀態 是以配置表示。The state of the open tool windows is represented by a layout. 您可以透過 [View] 功能表以手動方式切換配置(如下圖所示),或在您執行動作(例如,偵錯工具或開啟分鏡腳本)時自動切換版面配置:The layouts can be switched manually through the View menu, as illustrated in the following image, or it is switched automatically when you carry out an action, such as debugging, or opening a Storyboard:

選取新的版面配置

您可以使用 View > Layout 來建立新的版面配置 > 儲存目前的版面 配置 ... 功能表項目。It is possible to create a new layout by using the View > Layout > Save Current Layout... menu item. 此命令會將您目前的版面配置新增至功能表,讓您可以隨時選取它:This command will add your current layout to the menu so that you can select it at any time:

儲存目前的版面配置

並排編輯支援Side-by-side editing support

Visual Studio for Mac 可讓您並排開啟文字編輯器,或以卸離的浮動視窗顯示編輯器。Visual Studio for Mac allows you to open text editors side by side, or to have an editor as a detached floating window.

您可以透過 [View] 功能表項目,藉由選取 [ view > Editor columns] > 2 個數據行,或將編輯器索引標籤拖曳到編輯器區域的其中一個邊緣,以啟用兩個數據行模式:Two-column mode can be enabled through the View menu item by selecting View > Editor Columns > 2 columns , or by dragging an editor tab to one of the edges of the editor area:

二欄的並行模式

編輯器索引標籤可以拖曳出文件區域來建立浮動的編輯器視窗。Editor tabs can be dragged out of the document area to create a floating editor window. 此浮動視窗也支援並排的編輯器,而且可以包含數個編輯器索引標籤:This floating window also supports side-by-side editors, and can contain several editor tabs:

建立新的視窗

二欄並排及其他索引標籤

若要還原為單一開啟的編輯器,請選取 [檢視] > [Editor Columns] (編輯器資料欄) > [1 column] (單欄)。To revert to a single open editor, select View > Editor Columns > 1 column.

請參閱See also