netbeans macros - quote completion - netbeans

I have this netbeans macro, that simply outputs some html :
"<div class=\"kbox\">"insert-break
" <div class=\"title\"></div>"insert-break
" <div class=\"hide\">"insert-break
" </div>"insert-break
"</div>"insert-break
The problem is that when I fire the macro, I get :
<div class=""kbox>
<div class=""title toggle_div"></div>
<div class=""hide">
</div>
</div>
The quotes autocompletion fires on the macro output and the css class names end up outside their quotes... Is there a way to stop this behaviour for macros? I don't want to turn off autocompletion...
Using Netbeans 7.4

Put delete-previous after the double quotes.
In my code it looks like this:
"[<span class=\"" delete-previous
So you put one quote mark netbeans automaticaly adds second and then you delete it.

Related

WebStorm is adding unwanted line breaks in <p> tag

I have this code in an .ejs file, writing the second block on the web page:
<h1>
written by "<span class='accent'><%= params.user %></span>"
</h1>
written by "Salmon"
However, when I'm reformatting my code in WebStorm (Ctrl+Alt+L) it will change it to this, resulting in unwanted spaces before and after the quotation marks:
<h1>
written by "
<span class='accent'><%= params.user %></span>
"
</h1>
written by " Salmon "
I've tried going through the HTML & EJS code style pages in WebStorm, removing h1 from the lists it appears in to no avail. Besides those changes that I later rolled back I am using default settings.

How do I change opening and closing tag at the same time in Sublime Text 3

What is the easiest way to change the opening and closing code tag?
I especially need a way to do it using Sublime Text 3's Multi-Select... so I don't have to change it 1,000 times. And find and replace won't work because I need to change only specific matches.
EX: CHANGE ALL DIVs with class="item" to tr tags
(ignore my improperly formated code this is for example only)
<div class="item">foo foo bar is foofoobar</div>
<div class="item">bar foo is barfoo</div>
<div> not a match for .item</div>
<div class="item">foo bar foo is foobarfoo</div>
BECOMES
<tr class="item">foo foo bar is foofoobar</tr>
<tr class="item">bar foo is barfoo</tr>
<div> not a match for .item</div>
<tr class="item">foo bar foo is foobarfoo</tr>
I couldn't find the answer so I'm answering my own question.
What is the easiest way to change the opening and closing code tag?
I especially need a way to do it using Sublime Text 3's Multi-Select... so I don't have to change it 1,000 times. And find and replace won't work because I need to change only specific matches.
HERE GOES - THE ANSWER :
Install Emmet
Then select the opening tag you want to change.
(if you need to multi select -->) Hit ALT + F3.
Now (with Emmet installed) hit CTRL + SHIFT + u
Now change your tag and hit enter/return
EX: CHANGE ALL DIVs with class="item" to tr tags
(ignore my improperly formated code this is for example only)
<div class="item">foo foo bar is foofoobar</div>
<div class="item">bar foo is barfoo</div>
<div> not a match for .item</div>
<div class="item">foo bar foo is foobarfoo</div>
Highlight div class="item"
hit ALT + F3 to select all matching divs
hit CTRL + SHIFT + u
type "tr" and hit enter
DONE PRESTO MAGICO
<tr class="item">foo foo bar is foofoobar</tr>
<tr class="item">bar foo is barfoo</tr>
<div> not a match for .item</div>
<tr class="item">foo bar foo is foobarfoo</tr>
POSSIBLE ISSUES:
Package Control not working
I had to uninstall Package Control before installing Emmet as my Package Control had become corrupt somehow.
Solution:
This post answers the question of how to fix a corrupt package control item.
Why is Sublime Package Control not working?
Wrong Shortcode
It is possible your shortcode is conflicted with another plugin or your shortcode has changed from the default assignment.
Solution:
Go to
Preferences > Package Settings > Emmet > Key Bindings - Default
Look for "update_as_you_type" and check the "keys" assigned. This is the keyboard shortcut you should be using. If that still does not work. Try changing the key assignment.

How to surround some html code in Eclipse with new tag (shortcut)?

I want to surround some HTML code with <div> - how to do it in Eclipse with some shortcuts or macros. I do not want to repeat surrounding manually.
<p>some text</p>
I want to surround with <div> and achieve
<div><p>some text</p></div>
Follow below mentioned steps :
Select the text that you want to surround with tag.
Go to 'Edit > Quick Fix' or press 'Ctrl + 1'.
Double click "Surround with new element"

How to prevent Eclipse from indenting textarea's content on Ctrl+Shift+F?

I'm using Eclipse (Juno). I have a form on a JSP page that has a textarea as follows:
<textarea name="t"><c:out value="${val}" /></textarea>
When I format the code (ctrl shift F) it becomes:
<textarea name="t">
<c:out value="${val}" />
</textarea>
Which is fine except that it inserts extra spaces and lines in the text area. I like formatting my code using Eclipse, but the spaces/lines get added to the database when the form is submitted. Even worse, it gets compounded every time that form is submitted again. What am I doing wrong?
Try adding "textarea" to the list of inline elements on the Web->HTML Files->Editor preference page.

Org-mode: protect emphasis

How could I protect emphasis like italics or code within Emacs org-mode
when I have things like
/cologne/dome/
or
=<pre language="python">=
?
The following org-block demonstrates which parts work by default and which need a small amount of work-around to work.
The following was created using Org-mode version 7.8.03 (release_7.8.03.321.gaac1c). If you're using an older version it is possible that the behaviour is slightly different.
See Literal Examples and Monospace in the Org-Manual for full details
ORG
* Italics
- Your example simply works\\
/cologne/dome/
- It also works if your /example had / spaces within it/
- It will only fail if / your /have spaces on one end or the other /
* Code
Code blocks can be delimited in multiple ways:
** Inline formatting
- Using ~ for verbatim text works\\
~<pre language="python">~
- ~ renders the same as = for blocks =test= ~test~
** Code Blocks
- Single-line blocks
: <pre language="python">
- Multi-line blocks
#+BEGIN_EXAMPLE
asdf
#+END_EXAMPLE
HTML Export
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1"><span class="section-number-2">1</span> Italics</h2>
<div class="outline-text-2" id="text-1">
<ul>
<li>Your example simply works<br/>
<i>cologne/dome</i>
</li>
<li>It also works if your <i>example had / spaces within it</i>
</li>
<li>It will only fail if / your /have spaces on one end or the other /
</li>
</ul>
</div>
</div>
<div id="outline-container-2" class="outline-2">
<h2 id="sec-2"><span class="section-number-2">2</span> Code</h2>
<div class="outline-text-2" id="text-2">
<p>Code blocks can be delimited in multiple ways:
</p>
</div>
<div id="outline-container-2-1" class="outline-3">
<h3 id="sec-2-1"><span class="section-number-3">2.1</span> Inline formatting</h3>
<div class="outline-text-3" id="text-2-1">
<ul>
<li>Using ~ for verbatim text works<br/>
<code><pre language="python"></code>
</li>
<li>~ renders the same as = for blocks <code>test</code> <code>test</code>
</li>
</ul>
</div>
</div>
<div id="outline-container-2-2" class="outline-3">
<h3 id="sec-2-2"><span class="section-number-3">2.2</span> Code Blocks</h3>
<div class="outline-text-3" id="text-2-2">
<ul>
<li>Single-line blocks
<pre class="example">
<pre language="python">
</pre>
</li>
<li>Multi-line blocks
<pre class="example">asdf
</pre>
</li>
</ul>
LaTeX Export
\section{Italics}
\label{sec-1}
\begin{itemize}
\item Your example simply works\\
\emph{cologne/dome}
\item It also works if your \emph{example had / spaces within it}
\item It will only fail if / your /have spaces on one end or the other /
\end{itemize}
\section{Code}
\label{sec-2}
Code blocks can be delimited in multiple ways:
\subsection{Inline formatting}
\label{sec-2-1}
\begin{itemize}
\item Using \~{} for verbatim text works\\
\verb~<pre language="python">~
\item \~{} renders the same as = for blocks \texttt{test} \verb~test~
\end{itemize}
\subsection{Code Blocks}
\label{sec-2-2}
\begin{itemize}
\item Single-line blocks
\begin{verbatim}
<pre language="python">
\end{verbatim}
\item Multi-line blocks
\begin{verbatim}
asdf
\end{verbatim}
\end{itemize}
I guess you want to output the original /cologne/dome/, but not <i>cologne/dome</i>, right?
Two ways:
set #+OPTIONS: *:nil to turn off all emphasis symbols
modify org-emphasis-alist, remove the relevant items
I also asked a similar question here: How do I escape slash in org-mode?