
You can change the default Shift+ Enter shortcut for the DuplicateLine command in the IDE | Shortcuts options page.įind the DuplicateLine command’s shortcut ( Shift + Enter) and select it.Ĭhange the First shortcut text field and press OK to apply this change.
#Visual code duplicate line code#
The screenshot below shows the default options. 40 Dislike Share Save Code 2020 6. You can configure how CodeRush generates links and fields in the Editor | All Languages | Linked Text & Fields options page. You can declare new parameters based on the selection and existing parameters.

I'm afraid there's no way to duplicate this behavior. I've already selected, as a layout, VS Code from the Keyboard settings. If I do this in VS Community, the caret just duplicates. This feature recognizes enum element references and cycles through those elements if it detects an enum element cycling pattern in the surrounding code. Simple steps: put caret to line that you want to copy, go to VS Code menu and use: Selection -> Copy Line Up or Selection -> Copy Line Down the line should be duplicated Screenshot: Duplicate the current line in VS Code menu on Windows. by selecting multiple lines in VS Code and pressing Shift + Alt + UpArrow or DownArrow, the lines would duplicate beneath or above. Recognize Enum Element References and Cycle Through Elements Press y, this will buffer a copy of the highlighted line.

Ctrl + Shift + D - duplicate line(s), (this is shortcut I added to my VS Code). In command mode, press Shift+V, this will highlight the line that the cursor is on. If you want to easily duplicate a line of code in Visual Studio Code, you can do it with a simple keyboard shortcut.

The Smart Duplicate Line can increment/decrement single letter identifiers and their parts based on a detected alphabetical pattern in the code. VS Code in command line - VS Code has its command-line interface (CLI). Increment/Decrement Single Letter Identifiers Parts When the Smart Duplicate Line duplicates items in collection initializers and in parameter lists, it adds commas automatically, if needed. To duplicate the current line of code in Visual Studio, you simply use the following shortcut key: Ctrl + C + V Yeah, that’s it.
