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

后端 未结 3 1197
执念已碎
执念已碎 2020-12-24 12:03

I use notepad++ and I like it

I specifically want it to do this :

  1. Close automatically HTML tags. (eg.
)
  • Close tags af
  • 3条回答
    •  挽巷
      挽巷 (楼主)
      2020-12-24 12:20

      For 2. you can't enter custom pairs for auto-complete (in the Auto-Insert section) with two characters. So this is not possible without a plugin. If I find one, I will update my answer.

      1. However, for auto closing code with semicolon ";", you can use this option and "trick" Notepad++ to not put it on every line inside a php tag (which I don't believe is a good use case), but put it only when needed. I tested with ; and ; as opening and closing tags, which essentialy gives you what you need (without the php tags check though) and it's not so nice. But if you use an opening tag of "$" and a closing one ";", then you can get an auto-close functionality whenever you use a variable (which will mean you are writing code).

      Please note that using < and > or any other similar pairs will break other auto-complete functionality (including the auto-close html tags). This is certainly bad, because it would be nice to have both <> auto close and html tags auto-close.

    提交回复
    热议问题