Automatic Tag Completion: how to turn it off?
The automatic html tag completion inside of jsp files is driving me completely insane. Automatically closing a typed tag is great if you're typing an entire file inline, but who does that?? Most of the time, I want to insert an opening tag in one place, and the closing tag in another, but IDEA tries to be helpful by automatically producing a closing tag that I immediately have to delete by hand.
Annoying!!!!
How do I get IDEA to stop this? Argh
请先登录再写评论。
I hope I know receipt of the happines.
1. Open Settings | Live Templates (M)
2. Open last (surround) group.
4. Choose T (surround with ]]>).
5. Click edit
6. Enable JSP in context group.
Now whenever you like to surround something with certain tag do select this
part of the file with plain text selection and press CtrlAltJ. Choose ]]>.
Now type tag name. Press Enter or Tab when finished.
-
Maxim Shafirov
http://www.jetbrains.com
"Develop with pleasure!"
Well, that's a handy trick, and I thank you for it, but it doesn't manage to disable the automatic tag closure feature. You can still type or any other tag and IDEA automatically types the ]]> closing tag for you.
What I want it to do is NOT insert that closing tag automatically! HELP!!
This is not currently possible. You can probably submit a feature request
for that.
-
Maxim Shafirov
http://www.jetbrains.com
"Develop with pleasure!"
Please tell me this has been fixed somewhere. I still can't find a way to disable the closing tag completion of html tags. I'm using IDEA 5.0.2 and this is crazy that this is considered a 'feature.'
Tthe majority of the time I think people are working with existing HTML and JSPs. Having the tags complete for you only slows you down since usually you need to surround stuff by tags in existing documents.
This bothers me so much that I end up not even using IDEA for my JSP editing which is a shame since I like having the tag attribute popups.
Doesn't this feature annoy others? I'm suprised that this is considered a 'feature.'
I found the auto-tag annoying also when they first introduced.
tag will be auto-closed:If there is no text to the right of the cursor when you type a , it will insert closing tag . The behavior is a bit strange. For example, if I start typeing out a table on the same line, only the
or | blah blah blha blah... blah blah blah. and then I CTRL+K cut the and then move it down to the end blah blah blah blah... blah blah blah. ]]>
You can also hit Select Word at Caret twice, and then Cut to do the same. I didn't even know about the CTRLALTJ surround with that Maxim mentioned. I will try to integrate that into my editing because it is even faster. But back to the auto-tag behavior. I've learn to deal with it but it is definately a mixed bag, because sometimes you want it and sometimes you don't. Sometimes I want it even when it won't do it, i.e. when there is text ot the right of the cursor. I would like the option to turn this feature off and instead have a keybinding for 'close tag', so that I can control when IDEA closes the tag. The behavior of 'close tag' should be that it should search backwards from the cursor and find the closest tag, and then search forwards from the cursor to the next tag and then insert the closing tag. If there is a selection, it could search backwards from the selection to find the tag, and then insert the closing tag right after the selection. For example, if I have
start of paragraph some sty|led text
If the cursor is on the word styled, and I invoke 'close tag', then I should get:start of paragraph some styled text
Something more advanced that IDEA could do which I think would work nicely is to automatically close tags using knowledge of the html dtd, e.g. tag con only contain , , ,, , etc. (See http://www.w3.org/TR/REC-html40/index/elements.html) So, I should be able to type an HTML table, and IDEA will automatically insert a closing tag for an open element when I start a new tag which can't be contained by the currently open element,e.g.I like features which just happen automatically without having to remember to press CTRLALTJ or whatever. I can't think of any situations where it would do the wrong thing.