crafting (and) JavaScript

WebStorm Live Templates Rock (Again)

WebStorm has this awesome feature they call Live Templates where you can configure a text in a certain filetype to autocomplete to something, even dynamic. See how I built the auto-completion for dateC which becomes dateCreated: 2020-05-02 15:27 CET, which is current date of course, in my custom format.

dateC + TAB
dateCreated: 2020-05-02 15:27 CET

See Live Template in Action
See Live Template in Action

I got tired of writing the metadata, I am using here in my tidbits (see the source) over and over again, metadata such as the current dateCreated, as seen before.

How to create this Live Template?

If you want to create the live template above do the following.

  1. Shift + Cmd + A (for "Find Action")

  2. Type "Live Template"

  3. Select the one with "Preferences" behind it

    Home 🏠
  4. Blog ✍️
  5. Tidbits 😋
  6. Projects 🛠‍‍
  7. About 💡