Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Notepad++ you can press CTRL+D to repeat selected code or the code on the same line when you press CTRL+D. This is very useful! Is there a similiar function in Dreamweaver CS6? I do have searched around, but did not find anything useful.

Thanks for your time.

share|improve this question
repeat code or repeat html tags? – AthomSfere Sep 24 '13 at 21:29
Not so convenient, but triple-click, ctrl-C, left arrow, ctrl-V...? – beroe Sep 24 '13 at 21:58
@AthomSfere duplicate selected text/code/html etc. – kanarifugl Sep 25 '13 at 22:27
up vote 3 down vote accepted

CTRL+D in Notepad++ just means "Duplicate current line".

I don't believe there's an equivalent in DW.

Perhaps use Autohotkey (or alike) to create a macro that moves to the start of the line, then selects to the end of the line, then inserts a blank line below, and then inserts your copied line:

Then bind that to CTRL+D (or whatever).

SendInput {Shift Down}{Up}{Shift Up}{Ctrl Down}c{Ctrl Up}{Ctrl Down}v{Ctrl Up}{Ctrl Down}v{Ctrl Up}

Also, you probably can create a macro like this directly in DW using its "Commands" to do the automation.

If you get stuck writing your macro/script, come back with any questions relating to that and create a new question here (but please don't come back expecting us to write it for you ;) ).

share|improve this answer
Brilliant tip, I will definitely check it out. – kanarifugl Sep 25 '13 at 22:27

To create a duplicate selection and line keyboard shortcut do the following;

For windows 7 Professional:

  1. In windows explorer go to "C:\Users\USER_NAME\AppData\Roaming\Adobe\Dreamweaver CS6\en_US\Configuration\Menus"
  2. Locate the file named: "Menus.xml"
  3. Make a copy and lock it so you have the original
  4. Open "Menus.xml" in a text editor such as Notepad++ or open it in Dreamweaver CS6
  5. Scroll down the file until you find the following code (should be somewhere around line 67; that's where I found it in the original "Menus.xml") Find this Tag
  6. Just under this tag copy and paste the codeblock below do not remove the comment: Be sure to add the code in the (Add "xxx" Here). It won't let me post the code snippet on the forum with out doing this.

Copy from line below

(Add "comment opener" Here)
        Concept2FORM Duplicate Selection or Selected Line Keyboard Shortcut 
        Autor: Ryan Wainwright of Concept2FORM LLC :: 3D Printing and Industrial Design Solutions
(Add "comment closer" Here)

(Add "<" here)shortcut key="Cmd+R" domRequired="false" command="if (dw.getDocumentDOM() != null) dw.getDocumentDOM().source.startOfLine(false); if (dw.getDocumentDOM() != null) dw.getDocumentDOM().source.arrowDown(1, true); if (dw.canClipCopy()) { dw.clipCopy() }; if (dw.getDocumentDOM() != null) dw.getDocumentDOM().source.startOfLine(false); if (dw.getDocumentDOM() != null && dw.canClipPaste()){MM.event.notify('','dw.clipPaste()')}; if (dw.getDocumentDOM() != null) dw.getDocumentDOM().source.arrowUp(1, false);if (dw.getDocumentDOM() != null) dw.getDocumentDOM().source.endOfLine(false)" name="Concept2FORM Duplicate Selection" id="WD_Duplicator_DupLineDown" (Add "/>" Here)
  1. After pasting the above code block search for "CMD+R" in "Menus.xml" and locate it within the "shortcutlist" tag. The code line will begin with the tag:
  2. I just commented it out as it is the refresh shortcut for the CSS window. Not necceasry for me.
  3. Save the "Menus.xml" document
  4. Close and reopen Dreamweaver
  5. Open an HTML document and goto source view.
  6. Now select the code you wish to duplicate and press "CMD+R"
  7. That should do it.

If you find you have an error, reopen "Menus.xml" and search for other shortcut commands with "CMD+R" and change them as desired.

Took me a while to write and figure this out so if you share it, please leave the comment containing author and web address. Thanks!!

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .