How to use "lorem" inside paragraph tag - emmet

I am just learning zen-coding and am trying to do this:
Entering 'lorem' and hitting tab will produce 50 word lorem text.
However, if I start with <p></p> and then type lorem + tab inside the tag, it does not produce the lorem text.
Is there a better way to do this?

Use this:
p>lorem
and then tab

Since people are still reading this I will add, if you want to print off many lorems inside of p tags you can do this:
(p>lorem)*7
Replace 7 with how many lines you want!

use this:
<p>
lorem*(how many line you want)

Related

How to shorten the first line in the Intellij console?

I want my first line at the top of the console to look like this:
, but mine looks like this, and it's long:
How can I shorten it to like the first picture?
I'm watching Java tutorials on youtube and their first lines ("C:\programs Files\Java\jdk\whatever"...) are always so short and pretty with 3 cute dots in the end, but mine is long and annoying.
You can define the lines which should be folded:
Right click on that line in the console
Choose "Fold Lines Like This"
Click OK
You can also define special keywords/phrases in this menu, where lines, which contains the phrase will be folded with ellipsis (...) at the end.
See the ConsoleViewImpl.java file in the source code of IntelliJ IDEA
This line (execution command) will be automatically hidden in case the string length is more than 1000 symbols.
So, once you add something to the execution command (for example by adding libraries), the execution command is folded automatically.

WebStorm wrapper text with square brackets

When I select some text, for example form-col and press [ I want to get [form-col] but WebStorm replace selected text with [. Is there a way to configure it?
I don't think that functionality exist. However you can use the Live template functionality. It's very useful and it does pretty much the same thing.
To do this, go on : [File]->[Settings]->[Editor]->[Live Templates]->user, Click button + and add a live template like:
In you html file when you write the abbreviation what you are added, press Tab and it generate you [] and place the cursor after the first [and now you can write your html tag [form-col]
Settings/Preferences
Editor | General | Smart Keys
Ensure that Surround selection on typing quote or brace option is enabled

Display 4-space indent as 2-space in Intellij IDEA

Is it possible without any code modification? Making a tab would insert 4 spaces, but in editor it would look like 2. I think it might be useful to display code from different libraries with the same indent size.
No. How could 4 spaces could look like 2? Only a Tab can look like any number of spaces.

Spaces between elements in HAML

How would you represent this in HAML?:
<a>Link</a> | <a>Link</a>
Note that I want to retain the spaces on either side of the bar.
I would write exactly what you've written, which is perfectly valid HAML. You may embed regular HTML into HAML:
%h1
<a>Link</a> | <a>Link</a>
Sometimes whitespace bites you when you're marking things up with HAML, and there is no pretty way of making your tags come out correctly. That is why HAML gives you the option of falling back to HTML.
Note that, if you're ok with one or more spaces between your links and the |, you can just write regular old HAML:
%h1
%a link
|
%a link
The new lines will be preserved, and render as a space in the browser, where any amount of any kind of whitespace will always be treated like a single space.
Put '|' on next line, new line will be preserved, and render as a white space.
%a link
|
%a link
meagar's answer is how I would do it, you could also use haml filters to write exactly the HTML you need.
This might sound dirty, but filters use is encouraged, see this article : http://chriseppstein.github.io/blog/2010/02/08/haml-sucks-for-content/

multiline code block in markdown adds unwanted tabs

today I'm implementing my page in nanoc (haml templates) and I wanted to write some posts in markdown, but when it goes to multiline code blocks something weird is happening - second line in code block has additional tabs. I've tried multiple markdown syntaxes, such as:
//double tab wrapping
line 1 is fine
line 2 is wrapping (don't know why!)
and
~~~
//tilde code wrapping
line 1 is fine
line 2 is wrapping
~~~
And both solutions gives me the result something like this:
line 1 is fine
line 2 is wrapping
Inspecting elements through browser shows that there is no additional padding - this whitespace is made with tabs for sure.
Can someone help me with this? Maybe I'm doing something wrong?
When you use = in Haml to include the results of a script, Haml will re-indent the inserted text so that it matches the indentation of where it is included. For example, if you have Haml that looks something like this:
%html
%body
.foo
= insert_something
and insert_something returns some HTML like this:
<p>
This is possily generated from Markdown.
</p>
then the resulting HTML will look like this:
<html>
<body>
<div class='foo'>
<p>
This is possily generated from Markdown.
</p>
</div>
</body>
</html>
Note how the p element is indented to match its position in the document.
Normally this doesn’t matter, because of the way whitespace in HTML is collapsed. However there are HTML elements where the whitespace is important, in particular pre.
What it looks like is happening here is that your Markdown is generating something like
<pre><code>line 1 is fine
line 2 is wrapping
</code></pre>
and when it is included in your Haml file (I’m guessing you’re using Haml layouts with = yield to include the Markdown) it is being indented and the whitespace is showing up when you view the page. Note how the first line is immediately after the opening tags so there is no extra whitespace.
There are a couple of ways to fix this. If you set the :ugly option then Haml won’t re-indent blocks like this (sorry I don’t know how you set Haml options in Nanoc).
You could also use the find_and_preserve helper method. This replaces all newlines in whitespace sensitive tags with HTML entity
, so that they won’t be affected by the extra whitespace when indented:
= find_and_preserve(yield)
Haml provides an easy way to use find_and_preserve; ~ works the same as =, except that it runs find_and_preserve on the result, so you can do:
~ yield