Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Keyboard shortcut to copy previous line in do file

    Does anyone know the keyboard shortcut to duplicate the previous line of code in a Do file? As in I have typed some code in line 1, my cursor is now in empty line 2, and I want to duplicate the code from line 1 into line 2.

    I know in an R script this is Ctrl+Shift+D, but obviously that is a run command in Stata. I've done it accidentally in Stata before so it's definitely doable, but I can't find anything online about it and have tried every combo of shortcuts I can think of.

    Thanks in advance!

  • #2
    On a Mac, the following combination will do it: ⌥⌘↑ (i.e. option+command+up) which does the copying into memory/buffer, followed by the usual paste shortcut ⌘V (i.e. command+V)

    Comment


    • #3
      Hi James, You've probably already figured this out but it's D (i.e. command+D) on a mac. It's the keyboard shortcut everyone wishes was 'run' like on windows

      Comment


      • #4
        Originally posted by Karly Furber View Post
        Hi James, You've probably already figured this out but it's D (i.e. command+D) on a mac. It's the keyboard shortcut everyone wishes was 'run' like on windows
        Ahh thank you! That makes perfect sense actually because I have a Mac that I used in school but use a PC for work, so explains why I couldn't figure it out on PC!

        Comment

        Working...
        X