Skip to content

Instantly share code, notes, and snippets.

View marcolabreu's full-sized avatar

Marco L. Abreu marcolabreu

View GitHub Profile
@marcolabreu
marcolabreu / Duplicate_Lines_in_Xcode_Keybinding.md
Last active July 21, 2020 08:39 — forked from emotality/duplicate_line_xcode.md
Xcode - Duplicate Line key binding

Key binding to duplicate lines in Xcode 11

Many posts and solutions add 3 different commands to IDETextKeyBindingSet.plist, but only Duplicate Lines is currently required.

  1. Delete Line already exists in Xcode 11, just add a keybind to it.
  2. Duplicate Current Line is not necessary because the solution bellow works correctly if the cursor is in a line or if multiple lines are selected. In both cases, it has some benefits over commands found in older posts: the clipboard is not touched, and a single undo reverts the change.

Steps

  1. Open below directory in Finder with Cmnd + Shift + G