Skip to main content
Participating Frequently
Mar 18, 2020 7:26 PM UTC
Answered

Want a keystroke for wrapping the selection in <code>

Once-upon-a-time I could type ctl-Q in the design window and the current selection would be wrapped in <code>...</code>. Now in DW 20.1 I cannot find any of these

   A keystroke to wrap the selection in <code>...</code>

   A menu item to do the same

   A way to define a keystroke to wrap the current selection

(I've found snippets, but they just insert a single string.)

 

Can you help? I need <code> a lot.

Fred Hansen

This topic is closed to new replies. Start a new post to keep the conversation going.
Jon Fritz
Jon FritzCorrect answer
Community Expert
Mar 20, 2020 3:21 PM UTC

I'm not sure who marked it as correct, but you can un-mark it if you feel the answer isn't right. Click the blue "Marked as Correct Answer" under my response to undo it.

It was probably marked as correct because DW CC2020 no longer allows for what you want to do and my answer is as close as you're likely to find.

Unfortunately, the workflow you were used to, has been changed. The last time it was possible to set Ctrl + Q to a Wrapping Snippet of <code></code> was in DW CC2015 (coincidentally, the version I still use for production).

4 replies

Participating Frequently
Mar 20, 2020 2:56 PM UTC

Ah, now I see. There are wrapping snippets. Although to use them you have to drive the mouse to the snippet window and double click. (Curiously, they do not work from the recent-snippets menu.)

 

Still, I must ask, how is this a correct answer? It calls for seven key presses instead of two. Or disruptive mouse movement.

Translate
Jon Fritz
Community Expert
Jon FritzCommunity ExpertCorrect answer
Community Expert
Mar 20, 2020 3:21 PM UTC

I'm not sure who marked it as correct, but you can un-mark it if you feel the answer isn't right. Click the blue "Marked as Correct Answer" under my response to undo it.

It was probably marked as correct because DW CC2020 no longer allows for what you want to do and my answer is as close as you're likely to find.

Unfortunately, the workflow you were used to, has been changed. The last time it was possible to set Ctrl + Q to a Wrapping Snippet of <code></code> was in DW CC2015 (coincidentally, the version I still use for production).

Translate
Participating Frequently
Mar 20, 2020 4:16 PM UTC

Thanks, I've redirected the "correct answer" flag.

Translate
Jon Fritz
Community Expert
Community Expert
Mar 18, 2020 7:31 PM UTC

Select the code you want to wrap

Hit Ctrl + T
Start typing the tag name you want (code hinting will add it)

Hit Enter twice

Wrapping Snippets are back in DW, and could be used, however there's no Keybaord Shortcuts for Snippets like there were in previous versions. Only "Keywords" that act like Emmet Abbreviations, which won't work with Wrapping Snippets.

Translate