Unable to use built in snippet functionality


#1

Hey guys I am unable to use the the snippets function which is built in to atom. I have followed the instructions as per the guide

http://flight-manual.atom.io/using-atom/sections/basic-customization/#configuring-with-cson

I am using Atom: 1.23.1
Mac OSX 10.13.1

My snippets.cson is as follows
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing “snip” and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
# ‘.source.coffee’:
# ‘Console log’:
# ‘prefix’: ‘log’
# ‘body’: ‘console.log $1’
#
# Each scope (e.g. ‘.source.coffee’ above) can only be declared once.
#
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it in the
# Atom Flight Manual:
# http://flight-manual.atom.io/using-atom/sections/basic-customization/#_cson

'.source.css':
  'tester':
    'prefix': 'xwz'
    'body': 'TEstTEstTEstTEst'

'.source.js':
  'console.log':
    'prefix': 'bog'
    'body': 'console.log(${1:"crash"});$2'
  'console.error':
    'prefix': 'orror'
    'body': 'console.error(${1:"crash"});$2'

I even copied the example snippets from the guide to use as a test to see if they worked and they still dont. When I enter the prefix in the .CSS or .JS file and press tab nothing happens?

I have tried restarting, reinstalling atom but still no luck…


#2

Could you please take a screenshot of your snippets.cson and post it? I would like to see the file as it appears to you in Atom.


#3

Hey thanks for responding, image on the way


#4


#5

Everything there looks correct to me. I copied and pasted exactly what you have under .source.js into my own snippets file and opened a blank JavaScript document to test and it worked seamlessly.

I’m not sure why you’re having trouble. Your file says JavaScript in the lower right-hand corner just like mine does, right?