Atom - Adding a keybind shortcut to insert code snippet
<p>I'm trying to create a keybind in the Atom text editor that will insert the code:</p>

<pre><code>&lt;cfdump var="##"&gt;
</code></pre>

<p>and </p>

<pre><code>&lt;cfabort&gt;
</code></pre>

<p>using ctrl+shift+d and ctrl+shift+a respectively, just as it is in Eclipse. The <a href="https://stackoverflow.com/questions/31761199/add-simple-keybinding-in-atom">previous</a> <a href="https://stackoverflow.com/questions/31360365/atom-editor-body-keybind-for-everything-except-vim-mode-insert">posts</a> don't touch on this issue.</p>

<p>So far, I've tried editing the keymap.cson file with </p>

<pre><code>'atom-text-editor':
  'ctrl-shift-d': 'custom:insert-dump'

'atom-text-editor':
  'ctrl-shift-a': 'custom:insert-abort'
</code></pre>

<p>and adding the below to init.coffee:</p>

<pre><code>atom.commands.add 'atom-text-editor',
  'custom:insert-dump':   -&gt;
    atom.workspace.getActiveTextEditor()?.insertText('&lt;cfdump var=\"\#\#\"&gt;')

atom.commands.add 'atom-text-editor',
  'custom:insert-abort':   -&gt;
    atom.workspace.getActiveTextEditor()?.insertText('&lt;cfabort&gt;')
</code></pre>

<p>I've managed to get the &lt; cfabort > to work, but the cfdump just produces a newline. I'm sure I'm making some silly mistake. Any suggestions?</p>

<p>Thank you.</p>