auto-indent

editing the NetBeans source formatting standard

假如想象 提交于 2020-01-10 00:34:40
问题 Is there any way of changing the standard by which NetBeans automatically formats the code when doing "Source->Format"? I seem to remember seeing this option somewhere, but I can't find anything about it. 回答1: You can change a very limited number of settings related to formatting. open up netbeans IDE Go to tools->options click on Editor button on top left of the options dialog box click on the formatting tab select PHP from the language select box then you would be able to see the required

editing the NetBeans source formatting standard

老子叫甜甜 提交于 2020-01-10 00:34:05
问题 Is there any way of changing the standard by which NetBeans automatically formats the code when doing "Source->Format"? I seem to remember seeing this option somewhere, but I can't find anything about it. 回答1: You can change a very limited number of settings related to formatting. open up netbeans IDE Go to tools->options click on Editor button on top left of the options dialog box click on the formatting tab select PHP from the language select box then you would be able to see the required

Eclipse Java code formatting

微笑、不失礼 提交于 2020-01-05 07:12:22
问题 I'm writting a GUI program. It has several JPanels that conatin other components. It would be really nice if my code would look like this: parent component code child component code grandchild component code instead of this: parent component code child component code grandchild component code It would make the code far more readable. Is(Are) there some character(s) I can put in my code that Java will ignore, but Eclipse would detect it as a part of code that has to have additional indentation

Eclipse Java code formatting

不想你离开。 提交于 2020-01-05 07:12:10
问题 I'm writting a GUI program. It has several JPanels that conatin other components. It would be really nice if my code would look like this: parent component code child component code grandchild component code instead of this: parent component code child component code grandchild component code It would make the code far more readable. Is(Are) there some character(s) I can put in my code that Java will ignore, but Eclipse would detect it as a part of code that has to have additional indentation

Python IDLE file editor thinks I want more auto-indent than I do

假如想象 提交于 2020-01-05 04:29:24
问题 I have a bit over 500 lines of code-plus-comments that I've written over the past few days. It runs (see edit) , and does what it's supposed to. But whenever I hit enter after any text, IDLE fills in whitespace to column 28. If I go from column 28 and type a line that should need more indentation, for example For i in range(25): , and hit enter, it still only indents to column 28. When I edit a new file, it indents the right amount. When I try extending a logical line to multiple physical

Indentation Error with Sublime Text

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-31 12:08:13
问题 I'm trying to use the auto-indentation feature in Sublime Text 3 for HTML. I've got some block comments in the html and selecting Edit>Line>Reindent works until it hits a block comment. Try to reindent the example here: <html> <head> <title>Testing Indent</title> </head> <body> <table> <tr> <td> Cell 1 </td> </tr> <tr> Cell 2 <!--Block Comment Here And a Little More Here --> </tr> </table> </body> </html> and it turns out like this: <html> <head> <title>Testing Indent</title> </head> <body>

Tab key == 4 spaces and auto-indent after curly braces in Vim

佐手、 提交于 2019-12-27 16:09:06
问题 How do I make vi-Vim never use tabs (converting spaces to tabs, bad!), makes the tab key == 4 spaces, and automatically indent code after curly brace blocks like Emacs does? Also, how do I save these settings so I never have to input them again? I've seen other questions related to this, but it always seems to be a little off from what I want. 回答1: As has been pointed out in a couple of answers below, the preferred method now is NOT to use smartindent, but instead use the following (in your

Tab key == 4 spaces and auto-indent after curly braces in Vim

随声附和 提交于 2019-12-27 16:08:07
问题 How do I make vi-Vim never use tabs (converting spaces to tabs, bad!), makes the tab key == 4 spaces, and automatically indent code after curly brace blocks like Emacs does? Also, how do I save these settings so I never have to input them again? I've seen other questions related to this, but it always seems to be a little off from what I want. 回答1: As has been pointed out in a couple of answers below, the preferred method now is NOT to use smartindent, but instead use the following (in your

Set auto-indent not to indent labels

痞子三分冷 提交于 2019-12-24 03:11:33
问题 I'm using Eclipse CDT on Windows. I should add that I'm delighted, overall, with the auto-format feature. But one thing bugs me. I can't figure out how to configure Eclipse to not indent lines with labels. This is what I want: void myfunc() { goto MYLABEL; MYLABEL: return; } but what I get is this: void myfunc() { goto MYLABEL; MYLABEL: return; } How can I configure Eclipse to get exactly what I want? In Code Style --> Formatter , there's no section for "labels" under "Indentation". 回答1: This

Autoindent : smartindent and indentexpr

社会主义新天地 提交于 2019-12-24 01:19:45
问题 When I'm editing a Python file, for example: def my_func(): print('Something') <-- CURSOR IS HERE and I want to add a comment by typing a # , the line is automatically reindenting to the very beginning of the line: def my_func(): print('Something') #<-- CURSOR IS HERE I found that it's an effect of the smartindent option, so to fix it, I just have to run :set nosi (or disable it in my .vimrc). But in Vim's help, in :h 'smartindent' , you can read this: When 'cindent' is on or 'indentexpr' is