Notepad++ auto-close HTML tags in PHP files

15,683

Solution 1

This is a bit annoying, but you could temporarily switch to HTML language, and when you're done, switch back to PHP language.

Solution 2

Install the TextFX plugin and go to menu TextFXTextFX Settings → +Autoclose XHTML/XML <Tag>.

Solution 3

Try CCompletion. It's an auto-completion plugin for Notepad++, and it might suit your needs: here.

Also, the next Notepad++ 5.0 will feature auto-completion. You can grab a beta version somewhere over the web - look over here.

Solution 4

I have found a solution which could ease up the issue.

In menu SettingsPreferences in the Auto-Completion tab, try to add < > and ? ? in the blanks.

Share:
15,683
Headshota
Author by

Headshota

Hey there! My name is Shota Bakuradze, I'm a software developer. Currently into Ruby and Rust. I love coding, learning about programming fundamentals and best practices. In spare time I enjoy playing my guitar, train mixed martial arts and sometimes even do some photography.

Updated on June 14, 2022

Comments

  • Headshota
    Headshota almost 2 years

    In Notepad++, how can I enable to auto-close HTML tags in PHP files?

    I'm able to do this in HTML and XML files (I think the TextFX plugin does it), but in PHP files it doesn't work. Is there a plugin (or built-in functionality) to enable auto-close HTML tags in PHP files?

  • Headshota
    Headshota about 13 years
    I don't think CCompletion has HTML tag auto-closing, but thanks =)
  • davidosomething
    davidosomething about 13 years
    pretty sure this is the answer, but you have to switch to HTML in the language menu instead of PHP :D
  • Peter Mortensen
    Peter Mortensen almost 6 years
    Do you mean for "Matched pair 1" and "Matched pair 2"? A screenshot (with filled-in values) would be helpful. Thanks in advance.