Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Short answer: TextFX

Long answer: (Yes i know you linked that thread, but read all the answers there) use http://stackoverflow.com/a/7029595 for the PHP, and use http://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|improve this answer
    
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. –  Danny Apr 17 '13 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 '13 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. –  tastro Jun 6 at 6:51

Not a full answer, but a road to try:

  1. Save in Notepad++
  2. run formatting utility (in CLI or GUI utils)
  3. re-open in N++

Would be much faster than opening Eclipse, though may need alot of configuration to clone Eclipse's style.

share|improve this answer
    
No idea what you are trying to say. –  tastro Jun 6 at 6:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.