Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Override default snippets in Atom

I am trying to override default snippets in Atom, because I want to change the default script snippet from

<script charset="utf-8"></script>

to

<script src=""></script>

I have put the following into snippets.cson.

'.text.html':
  'Comment':
    'prefix': 'com'
    'body': '<!-- $1-->'
  'Script':
    'prefix': 'script'
    'body': '<script src="$1"></script>'

My 'com' snippet works fine. But script results in the default snippet, not my new one.

like image 784
Paul Byrne Avatar asked Aug 26 '14 15:08

Paul Byrne


1 Answers

  1. Add a snippet that overwrites an existing snippet
  2. Quit Atom
  3. Start Atom
  4. Trigger the newly added snippet, and the original snippet will trigger
  5. Open the ~/.atom/snippets.cson file and Save the file (no changes need be made)
  6. Trigger the snippet again and it will use the customized version

Apparently its a bug right now.

via https://github.com/atom/atom/issues/2695

like image 114
SufferMyJoy Avatar answered Oct 05 '22 16:10

SufferMyJoy