Skip to main content
exhibitorm99666455
Inspiring
July 24, 2019
Answered

Need to create custom keyboard shortcut for snippet

  • July 24, 2019
  • 2 replies
  • 1908 views

The previous versions of Dreamweaver allowed me to create a custom snippet, then assign a keyboard shortcut to it so I could insert it into my code on the fly. How can I do this in 2019?

This topic has been closed for replies.
Correct answer Jon Fritz

There is no way to add shortcut key strokes, like Ctrl + Alt + Letter, to Snippets in the last few versions of DW. These days, Snippets get Emmet-like abbreviations that are then expanded using the Tab key. The last version I know for sure that still has standard keyboard shortcuts is CC2015, which is no longer available via the CC Desktop App.

You can still get it from ProDesignTools.com though. Their site uses Adobe's actual files for the download, so they're at least legitimate versions of the program. You just need to make sure to follow the directions exactly, otherwise you get a 403 Forbidden error.

2 replies

Participating Frequently
July 10, 2022

There is a software call `lintalist` that can do this => https://github.com/lintalist/lintalist .

And there is a Post talks briefly about how to use it https://www.autohotkey.com/boards/viewtopic.php?f=76&t=85098 

 

The key is to use the `^|` to specify your caret position in your snippet.

And `[[Selected]]` to insert the text you have selected (for wrapping around).

A sample code could be:

<span class="AAA">^|[[Selected]]</span>

 

Nancy OShea
Community Expert
Community Expert
July 24, 2019

From the Snippets Panel, click on any snippet and Edit it.   Where it says Trigger Key, add your keyboard shortcut.  The key + TAB will insert your snippet.  Hit OK.  Repeat for other snippets.

Nancy O'Shea— Product User & Community Expert
exhibitorm99666455
Inspiring
July 24, 2019

Trigger Keys are not the same as shortcut keys, as they predetermine the shortcut, which is not ideal.

Shortcut keys utilize a more natural approach – i.e. Ctrl + B = bold.

I need custom shortcut key configurations for my coding.

Nancy OShea
Community Expert
Community Expert
June 9, 2022

With a `Hotkey`,

1. I select `a piece of code`, and then

2. press the hotkey.

3. Then Snippet will be inserted (wrapped around) before and after that piece of code, nicely.

 

With a `Trigger key`,
1. I need to write some `Trigger code`

2. then `Tab` 

3. then the Snippet is inserted. 

4. Then I have to select & copy & paste to move the `piece of code` into the newly inserted Snippet at the *correct position*. 

 

That is not efficient -- the ability of "insert & wrap around `the selected piece of code`" no longer exists

-- because you can't "insert" some `Trigger code` *while* having a piece of code *"selected"*. 

 

Also, the `Trigger code` only works in the "source code view", does not work in "design view"  (as a `Hotkey` would/should be).

 

Did I understand the `Trigger key` wrong? Is there a better approch? 


Since 2017 when DW was rebuilt, Snippets have not been able to wrap.

 

Code Snippets & Trigger Keys explained:

 

Optionally you may wish to use Emmet short codes.

https://docs.emmet.io/cheat-sheet/

 

Nancy O'Shea— Product User & Community Expert