多重游標編輯Multi-caret editing

多重插入點編輯可讓您一次新增 n 個插入點數目。Multi-caret editing allows you to add n number of insertion points at a single time. 處於多重插入號模式時,您可以透過滑鼠點擊或透過鍵盤命令,將其他游標新增至您的檔。When in multi-caret mode, you can add additional carets to your document either via mouse clicks or via keyboard commands. 主要插入號是以紅色游標表示,而次要游標則以淺藍色色彩表示。The primary caret is denoted by a red cursor, while the secondary carets present in a light-blue color. 您可以透過金鑰停用多重插入號編輯模式 ESCMulti-caret edit mode can be disabled via the ESC key.

啟用多重插入點編輯Enabling multi-caret editing

鍵盤Keyboard

您可以透過鍵盤以數種方式啟用多重插入號模式。You're able to enable multi-caret mode via the keyboard in several ways. 下表提供可用來輸入多個插入式編輯之特定模式的鍵盤快速鍵:The following table provides the keyboard shortcuts available to enter specific modes of multi-caret editing:

熱鍵Hotkey 動作Action
⌥⇧.⌥⇧. 插入下一個相符的插入號Insert next matching caret
⌥⇧;⌥⇧; 在所有相符的位置插入游標Insert carets at all matching
⌥⇧,⌥⇧, 移除最後一個插入號Remove last caret
⌥⇧/⌥⇧/ 將最後一個插入號下移Move last caret down

當您叫用命令時,這些行為都會錨定到插入號的目前位置。Each of these behaviors are anchored to the current position of the caret when you invoke the command. 例如,如果插入號是在 "name" 一字的開頭,而您叫用 [在所有相符的字元插入游標] (⌥⇧; ) 您目前檔中的每個 "name" 一字的實例都會在單字開頭插入插入號。For example, if the caret is at the start of the word "name" and you invoke "Insert carets at all matching" (⌥⇧;) each instance of the word "name" in your current document will have a caret inserted at the start of the word. 同樣地,如果您叫用 [插入下一個相符的插入號] 命令 (⌥ ) ⇧],則會將插入號放在 "name" 這個字的下一個實例。Likewise, if you invoke the command "Insert next matching caret" (⌥⇧.) then a caret will be placed at the next instance of the word "name". 您可以多次叫用此命令。This command can be invoked multiple times.

多個插入號鍵盤

滑鼠/觸控板Mouse/touchpad

藉由使用游標,您可以為多個游標釋放選取特定的插入點。By using your cursor, you are able to free select specific insertion points for your multiple carets. 當鍵盤快速鍵系結至相符的字串時,您可以手動將插入點插入檔中包含游標的位置。While the keyboard shortcuts are bound to matching strings, you can manually insert a caret anywhere in the document with the cursor. 設定游標之後,每個都將會回應您在鍵盤上輸入的按鍵專案。Once the carets are set, each will echo the key entries you type on your keyboard.

若要使用滑鼠插入多個游標,您必須按住⌘⌥,然後按一下您想要輸入游標的位置。To use the mouse to insert multiple carets, you must press and hold ⌘⌥ and click where you would like the carets to be entered. 只要保留了⌘⌥金鑰,您就會處於插入模式。You will be in insertion mode as long as the ⌘⌥ keys are held. 如果您在不正確的位置插入插入號,則可以繼續保留⌘⌥並在相同區域中按一下,以移除插入號。If you insert a caret in an incorrect location, you can remove the caret by continuing to hold ⌘⌥ and clicking in the same area again. 當您將所有游標放在您想要的位置之後,請停止按下⌘⌥鍵,然後開始輸入。Once you have all of the carets located where you would like them, stop pressing the ⌘⌥ keys and start typing. 下列 GIF 示範如何選取一組插入點,以及移除錯誤的設定點。The following GIF demonstrates both selecting a set of insertion points as well as removing erroneously set points.

多點插入滑鼠

另請參閱See also