Skip to main content
Participating Frequently
March 18, 2020
Answered

Want a keystroke for wrapping the selection in <code>

  • March 18, 2020
  • 2 replies
  • 1042 views

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 has been closed for replies.
Correct answer Jon Fritz

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).

2 replies

Participating Frequently
March 20, 2020

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.

Jon Fritz
Community Expert
Jon FritzCommunity ExpertCorrect answer
Community Expert
March 20, 2020

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).

Participating Frequently
March 20, 2020

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

Jon Fritz
Community Expert
Community Expert
March 18, 2020

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.