snippets icon indicating copy to clipboard operation
snippets copied to clipboard

Configurable Quotes

Open amiuhle opened this issue 10 years ago • 10 comments

I like to use single quotes in my JavaScript. Whenever I use a snippet that uses double quotes by default, I have to get rid of the linting errors.

I noticed snippets handle tabs vs spaces correctly for the selected grammar. So maybe atom-core and individual grammars would have to add a new setting whether to use single quotes?

Any thoughts on this? If I give this a shot and make a PR, will it be merged?

amiuhle avatar May 20 '15 10:05 amiuhle

:+1:

s0undt3ch avatar Jul 06 '15 13:07 s0undt3ch

I came here to request the same thing :+1:

I like me some double quotes but all these snippets use single quotes which causes my linter to moan!

bookercodes avatar Jul 06 '15 20:07 bookercodes

How does snippets handle tabs vs spaces?

stramel avatar Oct 31 '15 02:10 stramel

How does snippets handle tabs vs spaces?

Tabs are specified using \t so I assume Atom just replaces that with either soft or hard tabs depending on your tab preference. Quotes however are hardcoded as ' or " depending on each snippet.

winstliu avatar Oct 31 '15 02:10 winstliu

If you prefer to use single quotes (same like myself) wrap your snippet around triple quotation mark. Have a look at the documentation.

https://atom.io/docs/v1.3.2/using-atom-snippets#multi-line-snippet-body

pawelgrzybek avatar Dec 20 '15 03:12 pawelgrzybek

+1

nerdpad avatar Feb 24 '16 20:02 nerdpad

In coffeescript I always use double quotes, because #{string interpolation} doesn't work with single, so hardcoded single quotes it's a mistake! :(

ghost avatar Nov 24 '16 17:11 ghost

+1 I only use double quotes in ruby when interpolation is necessary

enatividad avatar Jun 29 '17 06:06 enatividad

The default double quotes for things like describe breaks default Rubocop style guide! This should be an easy fix. Would anybody mind if I open a PR for that bit?

lacostenycoder avatar Jul 28 '20 16:07 lacostenycoder

@lacostenycoder, you're talking about changing an existing snippet from double quotes to single quotes? If so, you'd want to make that change within the package that defines it.

I don't know which package provides a describe snippet for Ruby — I don't see it in the language-ruby source, nor in language-ruby-on-rails. You can see on a package's settings page which snippets it provides, if any.

savetheclocktower avatar Jul 28 '20 18:07 savetheclocktower