[Solved] Can't get this snippet for text.plain working


#1

Hi.
I’m trying to get an snippet for use it in .gitignore files. The (pretty basic) snippet is:

'.text.plain':
  'Default .gitignore file':
    'prefix': 'wgignore'
    'body': '''
    bower_components/
    node_modules/
    '''

I don’t see anything wrong on it, but I can’t get it working. And I guess a gitignore file is text.plain, right?
The language-text package says the scope for plain text is text.plain, so, I don’t know what I’m doing wrong.
Can someone enlighten me, please?
Thanks.


#2

It works as expected here on Atom 1.0.19 and OS X 10.9.5. Does it work if you run Atom in safe mode?


#3

If you have the language-generic-config package of @leedohm installed then the scope for gitignore file if .text.generic-config. That may be the reason.


#4

That wasn’t the case, but thanks for the answer :D.
I don’t know what happened, but it works now, @john. (Well, it still don’t show a tooltip suggesting an autocomplete for that snippets, like in other cases does, but, at least, it works).
Well: I just updated the Linter package, but I doubt that would be the reason.

BTW, just for knowing about it: how can I run atom in safe mode?
I don’t find the option in the menu, Atom doesn’t appear to have manpages.
The search of Documentation says No guide results for safe :(. I’m clueless.

Again: thanks to both of you :).

Edit: Oh. Atom 1.0.19 and GNU/Linux kernel 4.2.2-1. I forget to said that. Archlinux up to date.


#5

You can start Atom in safe mode by running it from the command line with the --safe option, like so:
atom --safe


#6

I’m having the same issue. I’ve added a gitignore snippet, but it’s not auto suggested like snippets usually are. It does show up in the Snippets: Available menu.
I’ve added my snippet under two selectors.
I’ve started atom in safe mode.

'.text.plain':
  'Git ignores':
    'prefix': 'gitignore'
    'body': """
    jspm_packages
    node_modules
    bundle.js
    bundle.js.map
    dist
    """
'.text.generic-config':
  'Git ignores':
    'prefix': 'gitignore'
    'body': """
    jspm_packages
    node_modules
    bundle.js
    bundle.js.map
    dist
    """

Why wouldn’t this snippet be auto suggested?


#7

Yeah, you’re right: I have the same problem. It doesn’t bother me as much as the already commented one, but it’s still annoying.


#8

Interestingly, if you look at the snippets in the language-text package, the scope is not .text.plain but *:

Have you tried that instead?


#9

That obviously, work. But it doesn’t works because you give it the properly scope, but because you tell it to work in all scopes :þ. In any case, it’s a solution :D.


#10

It’s possible that there is a bug in the snippets engine that doesn’t properly recognize the plain text scope … and it has lasted this long because there aren’t typically plain text exclusive snippets.


#11

Thanks for the * tip, I’ll try that. I opened an issue in the Atom snippets package: