27

Is there a function (and shortcut) to reformat code in Notepad++

Like CTRL+SHIFT+F in Eclipse?

StackzOfZtuff
  • 2,534
  • 1
  • 28
  • 25
Tobias
  • 7,282
  • 6
  • 63
  • 85

2 Answers2

25

TextFX hasn't been updated for a long time. A more powerful choice is UniversalIndentGUI.

leoly
  • 8,468
  • 6
  • 32
  • 33
  • When you have no admin-rights, you should check [this answer](https://stackoverflow.com/a/29116453/6287240) – TmTron Jun 01 '17 at 11:52
  • 2
    It's been a while since this thread was active, but I must say TextFX is -although not maintained any more for a very long time- one of the BEST plugins ever made for NPP. Despite its age, it's still fully functional which means the developer has been very keen in thinking a long time ahead with his plugin features. I needed to reformat C-source code and with TextFX it's a breeze... – GeertVc Aug 18 '17 at 07:17
  • I agree with GeertVc. I will use IDEs for most programming, but when using Notepad++ (usually for C code) the whole point for me is to be using a lightweight editor. So in this case, I don't prefer "a more powerful" plugin, just one that's quick, simple, and light. – Broper Mar 16 '18 at 19:04
  • TextFX2 is now available. Install from the Plugin manager. Select TextFX Edit / Re-indent C++ code. – Skyfish May 19 '23 at 11:37
22

If you are working with C++ then you can use the TextFX features. Go to

TextFX->Edit->Reindent C++ code

And regarding shortcuts you can always modify your shortcuts for NPP by using

Settings->Shortcut mapper

in this case go to

Settings->Shortcut mapper->Plugin commands: #141 

and modify it to CTRL + SHIFT + F.