7

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.

1 Answer 1

6

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.

3
  • 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.
    – iordanis
    Apr 17, 2013 at 18:16
  • 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
    – Uberfuzzy
    Apr 18, 2013 at 16:15
  • 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.
    – Jo Smo
    Jun 6, 2014 at 6:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .