6

If I'm in Netbeans and I want to wrap a div tag around the sentence "hello world", I know I can start typing a div on the left side then press CTRL + Space to finish the div tag on the left side of the sentence. However, is there a shortcut such that I can finish the div on both sides of the sentence <div> "hello world" </div> without having to first write it on the left side, then click on the right side and write </div>?

rayryeng
  • 102,964
  • 22
  • 184
  • 193
  • 6
    Problem solved: highlight a word or sentence, then press alt + enter and select Surround with Tag option :) –  Dec 27 '15 at 10:50
  • Shortcut works. Ok. But Default value to "Surround with Tag" is DIV. Can I change it ? – pauluZ Aug 27 '19 at 21:03

2 Answers2

6

I didn't find any tag wrap option in netbeans but discovered an alternative. Install emmet plugin and use wrap with abbreviation from Edit>Emmet>Wrap with Abbreviation. For details check the following link...

https://docs.emmet.io/actions/wrap-with-abbreviation/

M.Islam
  • 1,184
  • 2
  • 13
  • 16
0

The default tag offered is DIV but if you type an alternative such as P it replaces the tags at both ends of the selected text.