All Questions
Tagged with code-snippets atom-editor
45 questions
0
votes
1
answer
22
views
Can Atom Editor snippets be composed for expansion
Does there exist some inclusion mechanism whereby snippet expansion results in the expansion of other snippets?
For example, something along the lines of:
'Part 1' :
'prefix': 'part1'
'body' : '...
0
votes
1
answer
81
views
Atom Snippets for tex files
I have a .tex file to which I want to add snippets. I have tried the following
'.source.tex':
'console.log':
'prefix': 'Hello'
'body': 'Hello World!'
but it doesn't seem to work. (I have ...
0
votes
1
answer
109
views
Editing a snippet in a package in Atom
In Atom, if a package contains snippets, how do you edit them or delete/deactivate some whilst keeping the rest?
I know I can disable the snippets and copy them into Atom->File->Snippets. ...
0
votes
1
answer
85
views
How can I modify Atom HTML auto complete to change what <p> completes?
I am having trouble changing the autocomplete for <p> in Atom. I want to change the autocomplete from <p></p> to <p> For my snippets.cson I have:
'.text.html.paragraph':
'...
1
vote
2
answers
218
views
Atom: how to make newlines with snippets
I'm trying to create a simple snippet:
'.source.c':
'prinf':
'prefix': 'souf'
'body': 'printf("%$1\n");'
The problem is: it actually makes the newline instead of writing \n:
...
1
vote
1
answer
69
views
How to alter existing Atom.io Snippets
I'm looking to alter Atom.io preset HTML/CSS snippets, rather than creating new ones.
Specifially looking to change tab
Ive tried using the .source in snippets.cson but had no luck
I want:
link rel=...
-1
votes
1
answer
335
views
VSCode same Snippet with different placeholder
"test": {
"prefix": "test",
"body": "${1:hello} ${1:world}"
}
Expected Result:
hello world
Current Result:
hello hello
I am trying to create snippet with same index and different ...
2
votes
1
answer
105
views
Is there a way to add custom variables when creating custom Atom code snippets?
I want to create custom snippets in Atom, but I want to be able to supply custom variables and it automatically uses those. For example, I want to be able to type something like nm methodName param1 ...
1
vote
1
answer
55
views
Only first two code snippets in my snippets.cson work in Atom
I want to use my own code snippets in Atom, but after hours of trying I am still not able to use more than first two of them and I cannot find a mistake.
When I was looking for a solution I found ...
1
vote
1
answer
105
views
Atom Snippets - Getting saved but not listed and doesn't work
My snippets.cson file :
'source.css':
'Default':
'prefix':'dcss'
'body':"""
*
{
padding : 0;
margin : 0;
$1
}
"""
When I save this file, I get no error, but when I type "dcss" ...
2
votes
1
answer
194
views
Atom - Nested snippets with tab stops error
I just started using Atom for LaTeX, and i use a lot of snippets to make my life easier.
Now, this often means that i will "nest" snippets, meaning i might use a snippet for a fraction ...
\frac{$1}{...
0
votes
1
answer
273
views
Code snippet in the Atom text editor returns the error: unexpected newline
I've been trying to add my first snippet in the Atom text editor and I keep getting the error that there's an unexpected newline:
'.source.js':
'Console log':
'prefix': 'log'
'body': '...
0
votes
1
answer
43
views
atom <script> snippet, one line
I would like the atom script snippet when I type "script" followed by TAB to be one line instead of as now:
<script type="text/javascript">
</script>
I am not sure how to add such a ...
0
votes
2
answers
81
views
Text editor supports snippets inside snippets without breaking cursor next position
I'm using Atom to write LaTeX and C++. When I use for example a snippet:
Prefix 'fr' expands to '\frac{$1}{$2} $3' meaning that typing 'f r TAB' creates the sentence '/frac{}{}' and places the cursor ...
0
votes
1
answer
267
views
Atom Snippets not working for Shell Script
I am trying to make a snippet for the headings of a Shell Script,
#!/bin/bash
Name of program
Author
And that kind of stuff. But my snippet is not working!
Here's my Snippet:
"'.text.sh':
'...