You are not logged in.
Pages: 1
Peace!
Is there a way to automatically format a given source code interactively while typing? As far as I know, it is only possible to enter if(/tab to get
if( )
{
}
Is there a way to automatically format x=x+2; to
x = x + 2;/n
for easier reading without manually entering spacebar and enter at the end.
I am currently using the geany IDE.
http://en.wikipedia.org/wiki/Indent_style
Thanks!
Offline
Almost all programmers editors(vim ,emacs etc) support auto indentaion for almost all programming languages....
but x=x+2..... i dont know if that is possible...
Offline
Is it really so much effort to press the space bar and enter button..?
Offline
It's certainly possible to make this happen. Inserting newlines and indenting automatically when ; is pressed would be especially easy. Automatic spacing around operators would be trickier, but possible. Probably when a char that only appears in an operator is pressed you could call a function that adds spaces or not depending on the context. It could add a space before unless there already is one or the preceding char is part of an operator, and could add one after in all cases. If the preceding char is a space and the char before that is part of an operator, it could delete the space.
However I find autocorrection more annoying than not.
Last edited by pauldonnelly (2009-01-05 22:18:27)
Offline
it would take me around 15 minutes to write a programm that handle files and alter its structure this way, if you spend this amount of time you would have a convenient way
Offline
Thanks for all the replies.
Is it really so much effort to press the space bar and enter button..?
Well, it's not.... but it's really a hassle especially when it's unnecessary. It's pretty much a given I will press enter right after ";", might as well reduce it to 1 keystroke.
I'll need more research on this i guess..
Offline
To each his own style I suppose. Personally, I abhor editors that insert things without me asking. I do like editors that auto indent though. Geany is my personal favorite editor on Linux, EditPadPro is my favorite editor under Windows.
Offline
Pages: 1