Keystroke to surround selected with tags in Eclipse (or cancel auto-closing)

361 Views Asked by At

I am used to an editor that does not auto-close tags, but I'm exploring Eclipse.

Sometimes, I already have a block of text entered, and would like to put matching tags around it.

If I type at the beginning of the block, I end up with the closing tag (yay!) before the beginning of the block (boo.) I can think of two solutions but don't see them in the keybindings preflet:

  1. Some way to select text, hit a key combo, enter the tag name, and have it surround the selected text with matching tags.
  2. Some way to, at the moment the auto-close tag comes up, hit a key combo ( you know, shorter than "ctrl+shift+rightarrow four times then delete") to get rid of the auto-close tag. Then I can just go to where I want it and type "

How can I do this, or do what I'm looking for a different way, with a quick-to-use keybinding?

1

There are 1 best solutions below

1
On

How about :

Window > Preferences > XML > XML Files > Editor > Typing > uncheck "Insert a matching end tag" at When typing a start tag