自訂 IDECustomizing the IDE

Visual Studio for Mac 可以使用各種方式加以自訂,讓使用者能夠在效率與審美方面符合其需求的環境中開發應用程式。Visual Studio for Mac can be customized in a variety of ways, 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:



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 have not 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 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.

工作區版面配置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 pads that contain useful information for accessing and managing application files, testing, and debugging.


檢視和排列板Viewing and arranging pads

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

Solution Pad

Visual Studio for Mac 提供包含其他資訊、工具和瀏覽輔助工具的板,這些全都可透過瀏覽至 [檢視] > [板] 功能表項目,並選取面板來加以新增以進行存取:Visual Studio for Mac provides pads containing additional information, tools, and navigation aids, all of which can be accessed by browsing to the View > Pads menu item and selecting a pad to add it:


板也可以透過各種不同的命令自動開啟,例如在檔案中尋找 (Shift + Cmd + F) 命令可開啟搜尋結果的卸離板。Pads may also be opened automatically by various commands, such as the Find in Files (Shift + Cmd + F) command, which opens a detached pad of search results.

板可以使用對您而言最有效益的任何方式在工作流程中移動或排列。Pads 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 pad, above or below another pad, or as a set of tabbed pads enabling you to quickly switch between them.

對於經常使用的面板,您也可以將面板從 Visual Studio for Mac 視窗中完全卸離,並為該面板建立另一個視窗。For frequently used pads, you can also completely detach a pad from the Visual Studio for Mac window, and create a separate window for that pad.

透過每個板右上角的切換圖示可以隱藏和關閉這些板:Pads can be hidden and closed by the toggles in the top-right corner of each pad:


自動隱藏的板會停駐在工作區的側邊,讓您在需要時能夠輕鬆存取這些板。Autohidden pads are docked to the sides of the workspace making them easily accessible when they are required. 將滑鼠停留在板上時會重新顯示板,而在滑鼠和鍵盤焦點離開板時則會予以隱藏。Hovering over the pad displays it again, and it will be hidden when the mouse and keyboard focus leaves it.

組織版面配置Organizing layouts

任何時候顯示的板都是取決於目前的內容。The pads that are displayed at any time are dependent on the current context. 例如,使用視覺化設計工具時,工具箱和屬性方格板最重要;偵錯時,最好有偵錯工具板來檢視堆疊和區域變數。For example, when using the visual designer, the toolbox and property grid pads are most important; when debugging, it is useful to have the debugger pads for viewing the stack and locals.

「版面配置」代表已開啟板的狀態。The state of the open pads is represented by a layout. 版面配置可透過 [檢視] 功能表手動切換 (如下圖所示),或者在您執行某個動作 (例如偵錯或開啟分鏡腳本) 時自動切換: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:


一定有一個使用中的版面配置,您在版面配置中所做的任何變更 (例如新增或重新定位板) 只會變更使用中的版面配置。There is always one active layout and any change you make in a layout, such as adding or repositioning a pad, will only change the active layout. 關閉 Visual Studio for Mac 之後,將不會儲存您所做的變更。Once you close Visual Studio for Mac, the changes you have made will not be saved.

不過,可以使用 [檢視] > [儲存目前版面配置] 功能表項目來建立新的版面配置。However, it is possible to create a new layout by using the View > Save Current Layout menu item. 這會將目前的版面配置新增至功能表,因此您可以隨時選取它:This 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.

2 欄模式可透過 [檢視] 功能表項目啟用,方法是選取 [檢視] > [編輯器資料行] > [2 欄],或是將編輯器索引標籤拖曳到編輯器區域的其中一個邊緣:2-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