Auto close of html tags and jsp, php, asp tags in notepad++ and a semicolon at the end of the line written of scriptlets

Regarding auto-closing html tags, for me only having html as the language didn't do the trick.

(This answer is incomplete, but is too large for a comment given the images.)


Changing the auto-complete preferences, as below, worked:

  • Settings > Preferences

settings_prefs

  • Auto-Completion tab > Auto-Insert section > html/xml close tag

auto-insert

I use Notepad++ v6.5.2


If you are editing a PHP file and want it to auto-complete the HTML tags, in addition to turning on "Auto-insert HTML/XML tags" in Preferences, you have to change the programming language to HTML while editing that file.

In Notepad++, go to the Language menu, and find HTML and click on it.

This will set the file's language to HTML so that auto-complete tags will work in a PHP file.

Even with the language set to HTML, it still highlights anything in <?php ?> tags as PHP code, and it does not affect auto-closing of brackets, if you have that enabled.

You must have Auto-Insert html/xml close tags on, as mentioned in Noha's answer.

  • Settings > Preferences
  • Auto-Completion tab > Auto-Insert section > html/xml close tag