On-the-fly code formatting
Posted: Thu Sep 02, 2010 2:33 pm
I had this "epiphany" the other day. I was browsing around some random C code written by someone who used a code formatting style I really didn't enjoy and I though that there must exist some sort of tool (in my case on Linux) I could use to make the code look the way I am familiar with.
The more I thought about it I began thinking it's weird that I haven't heard of any such tool, probably because it would be hard (and sometimes impossible) to write for certain languages.
I imagine having a tool (preferably integrated into vim) that dynamically changes the formatting of a C file to match my preferences. Another nice feature would be if it could automatically compress the code (basically remove most whitespaces) to the smallest possible before storing it to disk in order to save space.
Does such a tool or plugin exist?
The more I thought about it I began thinking it's weird that I haven't heard of any such tool, probably because it would be hard (and sometimes impossible) to write for certain languages.
I imagine having a tool (preferably integrated into vim) that dynamically changes the formatting of a C file to match my preferences. Another nice feature would be if it could automatically compress the code (basically remove most whitespaces) to the smallest possible before storing it to disk in order to save space.
Does such a tool or plugin exist?