Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put line breaks in text #285

Closed
fversepuy opened this issue Dec 29, 2013 · 6 comments
Closed

Put line breaks in text #285

fversepuy opened this issue Dec 29, 2013 · 6 comments

Comments

@fversepuy
Copy link

Hi,

I like to use Emmet multiplication operator combined with curly braces (for text), instead of making a multiple copy past. For example, let's say i have this line :
"This is a text I mean something I don't want or I can't write using Emmet syntax..."

What I do is just putting curly braces and a multiplier, like this, and expand :
{This is a text I mean something I don't want or I can't write using Emmet syntax...}*20
In most cases this is faster than copy-pasting 20 times or so...

Problem is that Emmet expand it on a single line, and I'd like to have it with line breaks. I tried putting "\n", "\t", "\n\t" and so on, at the end of the text, before the closing curly brace, but didn't work. Any idea? Is it possible?
ps : I'm using Emmet with Dreamweaver, but i think this issue is independent of the text editor.

Thanks!

@sergeche
Copy link
Member

Put ${newline} variable at the end of text, like so:

`{some text${newline}}*20

@fversepuy
Copy link
Author

Thanks a lot! Works nicely.
Where does it come from? I can't find this syntax in the Emmet documentation.
Also, as Emmet is all about typing less, I was wondering why not using something shorter like $nl?

@sergeche
Copy link
Member

@fversepuy
Copy link
Author

Ok, understood, thanks.
I found the variable definition in the original snippets.json https://github.com/emmetio/emmet/blob/master/snippets.json at line 7 : "newline": "\n" (I make it clear just in case this can be useful to a future reader).

@xpectmore
Copy link

xpectmore commented Apr 28, 2020

not sure if will work on your editors but here in Editplus (editplus.com) the best editor since '98 ,
i edit snippets.json and i insert inside ..

"cc:noie": "<!--[if !IE]><!-->\n\t${child}|\n<!--<![endif]-->", <-----this comma
			"php": "<?php\r\n\r\n?>"   <-------------------------that code
		},
		
		"abbreviations": {

so

,
"php": "<?php\r\n\r\n?>"

ans seems that php will transform in

<?php

?>

I REPEAT here in editplus work like that . now i should figure out how to move the cursor inside..

@9p6
Copy link

9p6 commented Feb 2, 2024

`{some text${newline}}*20

Exactly what I needed but I wish it was a little bit less verbose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants