Is there a SIMPLE way to format nano file text? My code is getting pretty messy, so it MAY help to format it.

  • 2
    I believe you're trying to remember indent – Jeff Schaller Aug 30 '18 at 14:47
  • I adjusted the title on the assumption that you're looking to format C code (within nano), and not, say English prose or Fortran code. – Jeff Schaller Aug 30 '18 at 14:55
  • 1
    Perhaps this astyle was the artistic program you were thinking of? – Jeff Schaller Aug 30 '18 at 14:55
  • Sometime second guessing the poster in not a good idea.You are forgiven, but to avoid more WRONG replies - can you delete the "for C code" even when nano is a text editor , not a C code editor in my case. – user238756 Aug 30 '18 at 15:23
  • I was distracted, then, by your last sentence: "There is an app ... to format C code". Is formatting C code not your intention? – Jeff Schaller Aug 30 '18 at 15:30

There is also clang-format command

| improve this answer | |

For formatting / "beautifying" C code, you have the packages in Debian, astyle, bcpp and uncrustify

For searching the packages:

$ apt-cache search beautifier | grep C
astyle - Source code indenter for C, C++, Objective-C, C#, and Java
bcpp - C(++) beautifier
bcpp-dbg - C(++) beautifier - debug
uncrustify - C, C++, C#, D, Java and Pawn source code beautifier
| improve this answer | |