Notepad++ General Purpose code formatter.

43,861

Short answer: TextFX

Long answer: (Yes i know you linked that thread, but read all the answers there) use https://stackoverflow.com/a/7029595 for the PHP, and use https://stackoverflow.com/a/3635611 for the HTML

Even longer answer: Notepad++ isnt an IDE. It is an text editor (an awesome and versatile one at that), and is only partially aware of what you are editing.

If you need such code beatifications/fixers from eclipse, then do it in eclipse (or what ever IDE of the language of your choice)! There is a PHP module for eclipse, and it works fine for this stuff. I use it every day. You can do the bulk of your coding in notepad++ if you still want, and just from time to time just open eclipse, and smack c+s+F, and then save.

Share:
43,861

Related videos on Youtube

makakas
Author by

makakas

Updated on September 18, 2022

Comments

  • makakas
    makakas over 1 year

    I enjoy a lot that I can hit CTRL+Shift+F on eclipse and it automatically formats the code according to a profile. My question is how can I do something similar on Notepad++? Where would I go about to find a good profile for that?

    I tried this answer

    It didn't work so well.

  • makakas
    makakas about 11 years
    Do u know if eclipse formats PHP as well? I am using few html in PHP and I dont seem to be able to get both of them formatted properly at the same time.
  • Uberfuzzy
    Uberfuzzy about 11 years
    From some cursory testing, it seems the formater in eclipse seems to only do simple re-indenting, nearly similar (but different) to the TextFX plugin. And in both cases, its not exactly helpful. Source code is not exactly easy to just blindly modify layout. You would likely end up spending less time by just writing more cleanly written code then trying to setup a good formatter
  • Jo Smo
    Jo Smo almost 10 years
    TextFX doesn't indent correctly in PHP. Sometimes it makes 2 or 3 tab spaces instead of one, and in some situations it makes none, when it should.