• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Need to create custom keyboard shortcut for snippet

Community Beginner ,
Jul 24, 2019 Jul 24, 2019

Copy link to clipboard

Copied

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?

Views

817

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 24, 2019 Jul 24, 2019

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

...

Votes

Translate

Translate
Community Expert ,
Jul 24, 2019 Jul 24, 2019

Copy link to clipboard

Copied

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 & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 24, 2019 Jul 24, 2019

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 24, 2019 Jul 24, 2019

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 24, 2019 Jul 24, 2019

Copy link to clipboard

Copied

Thanks, that's what I figured. Leave it to Adobe to invent the wheel, then change its shape and charge you twice as much.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 24, 2019 Jul 24, 2019

Copy link to clipboard

Copied

exhibitorm99666455  wrote

I need custom shortcut key configurations for my coding.

Sorry.  No-can-do.   Custom keyboard shortcuts are reserved for DW menu items.  

Code Snippets have Trigger Keys all their own which can be letters  or numbers followed by TAB.

And of course there are built-in Emmet shortcuts which are also invoked with the TAB key and save a lot of coding time.

Faster Coding with Emmet in Dreamweaver CC | Adobe Blog

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 09, 2022 Jun 09, 2022

Copy link to clipboard

Copied

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? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 09, 2022 Jun 09, 2022

Copy link to clipboard

Copied

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 & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 09, 2022 Jun 09, 2022

Copy link to clipboard

Copied

Thanks for the reply.

1.

If I did not misunderstand the meaning of wrap in Dreamweaver, I do think Snippets are still able to wrap around a piece of code. (Dreamweaver Version 2021).

 

Just select a piece of code, and then double click a Snippet in the Snippets panel. Then it wraps around that piece of code.

    -- as long as that Snippet has the `Wrap Selection` (not `Insert block`) enabled when you first created it.

Nsane24540801xdqu_0-1654820053895.png

 

It just not able to use with Hotkey anymore... 

2.

Also, you may want to update the web instruction in: 

Note:
To add or edit a keyboard shortcut for a code snippet, select Snippet from the Commands pop‑up menu.
https://helpx.adobe.com/dreamweaver/using/keyboard-shortcuts.html

to indicate this is for only old versions of Dreamweaver (as mentioned in the accepted answer above). 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 09, 2022 Jun 09, 2022

Copy link to clipboard

Copied

^

The misunderstanding of "not able to wrap" could come from my first post

 
the ability of "insert & wrap around `the selected piece of code`" no longer exists

-- that I refer to only when I use `Trigger key`.

(and its to point out the usefulness of `Hotkey`. )

 

(Sure, if you double click in the `Snippets panel`, you can still wrap. -- as written in my 2nd post)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 10, 2022 Jun 10, 2022

Copy link to clipboard

Copied

Wrapping Snippets were put back into the program a couple of versions ago (the original version this thread is about is CC 2019, a version or two after they had been removed), however the ability to use a real keyboard shortcut with them is still gone. Only the Emmet-like "keyword+Tab" insertion method is available and, as you've found, it doesn't work with Wrapping Snippets since the keyword overwrites what you are trying to wrap.

It's unlikely to ever be changed back though. DW is now in a minimum maintenance/development state with no plans for future bug fixes or new features. Adobe is only planning to make OS compatibility and security updates going forward, for those users who currently have the program and don't wish to change.

DW is essentially dying on the vine. Unless/until Adobe decides to begin development again (they don't tend to change their minds often), it will fall further and further behind current standards until it's no longer useful to active developers. At that point, they'll likely EOL the program.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 10, 2022 Jul 10, 2022

Copy link to clipboard

Copied

LATEST

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>

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines