auto-indent

Sublime Text 3, convert spaces to tabs

眉间皱痕 提交于 2019-11-29 18:45:26
I know there are a lot of posts about this, but I couldn´t get it to work. I use tabs for coding. Is there a way, to convert always spaces to tabs? I.e. on open and on Save files? Anyone got an idea? // edit: My desire is to do this automatically ! -> open, save or on the fly Does anyone know how to do? I tried this : import sublime, sublime_plugin, os class ExpandTabsOnSave(sublime_plugin.EventListener): # Run ST's 'expand_tabs' command when saving a file def on_pre_save(self, view): if view.settings().get('expand_tabs_on_save') == 1: view.window().run_command('expand_tabs') And here are my

How can I add auto indentation to UITextView when user type new line?

一世执手 提交于 2019-11-29 15:19:57
How can I add auto indentation to UITextView when user type new line? Example: line1 line2 <user has typed "Enter"> <cursor position> line3 <user has typed "Enter"> <cursor position> Lyndsey Scott Although it seems as if the OP isn't in fact looking for standard indentation in this case, I'm leaving this up for future answer seekers. Here's how you can automatically add an indent after every newline entry. I've adapted this answer from my similar recent answer about automatically adding bullet points at every newline . - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange

How to get auto indent (not smart indent) in emacs in all modes

天大地大妈咪最大 提交于 2019-11-29 14:05:45
问题 I'm new to emacs, and its indenting is driving me up the walls. It's too smart for its own good; it (incorrectly) thinks it knows how I want to format my source, but I don't have time to chase down every setting for every mode for every different language that I write code for; and many of those languages don't have any mode enabled at all. Here's the behaviour I'd like: TAB inserts indent RET inserts a new line then copies the blank characters from the start of the previous line to the first

Vim: How to indent to an open paren or bracket when hitting enter?

北城余情 提交于 2019-11-29 12:26:04
问题 I've been programming Python with Vim for a while but one thing I haven't been able to figure out how to do it set it to auto indent to the level of the last open paren. According to pep8 if you have an open paren and you need to break the line to fit in 80 columns then you're supposed to continue the next line at that open paren. Example: calling_some_really_long_function(that, has, way, too, many, arguments, to, fit, on, one, line) Obviously this is a crazy example, but that's how you're

Disable auto indent globally in Emacs

牧云@^-^@ 提交于 2019-11-29 06:04:08
How to disable auto indent in Emacs globally or only for some modes? I have a number of packages installed for RubyOnRails (ruby, html, js, css). Let's say I want to disable autoindent for css-mode. You may want to look for variable names containing the word electric . (This is the common Emacs parlance for actions which occur automatically when particular visible characters are typed.) In this instance, M-x apropos-variable RET electric RET shows me that there is a css-electric-keys variable containing a list of "Self inserting keys which should trigger re-indentation." You could use M-x

editing the NetBeans source formatting standard

一世执手 提交于 2019-11-29 03:04:34
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. 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 settings that can be changed. Latest version 7.3 will solve most of your needs. The formatting preferences

Automatic indentation for Python in Notepad++

一个人想着一个人 提交于 2019-11-29 02:53:54
I've been googling lots and this is getting really frustrating. It doesn't act like idle. Example: else: name = 'World' print 'Howdy', name print 'yay' but in Notepad++ else: # i press enter and this is what it does lands me here But I want to be able to do like in idle: after the : I can just press enter and keep on going. My English isn't that great. I have my filetype set to Python etc. and my format to unix. This is what you want: Settings > Preferences > MISC. > Auto-Indent (checkbox) -- Sometimes people ask, "How can I do x in program y?" I have a dream that one day "Use program z

How to avoid namespace content indentation in vim?

纵饮孤独 提交于 2019-11-28 20:59:06
问题 How to set vim to not indent namespace content in C++? namespace < identifier > { < statement_list > // Unwanted indentation } Surprisingly, 'cinoptions' doesn't provide a way to edit namespace content indentation. 回答1: Not sure when it was introduced but my installed version of vim, v7.3.353 has a cino option that handles cpp namespace explicitly. I am currently using the example value: cino=N-s and as per :help cinoptions-values NN Indent inside C++ namespace N characters extra compared to

How do I change the autoindent to 2 space in IPython notebook

不想你离开。 提交于 2019-11-28 17:29:53
I find that developing functions in IPython notebook allows me to work quickly. When I'm happy with the results I copy-paste to a file. The autoindent is 4 spaces, but the coding style for indentation at my company is 2 spaces. How do I change the autoindent to 2 spaces? Jakob Based on this question and the options found here : In your custom.js file (location depends on your OS) put IPython.Cell.options_default.cm_config.indentUnit = 2; On my machine the file is located in ~/.ipython/profile_default/static/custom Update: In IPython 3 the plain call does not work any more, thus it is required

Difference between Ctrl+Shift+F and Ctrl+I in Eclipse

二次信任 提交于 2019-11-28 15:46:14
I have been used Ctrl + Shift + F to correct indentation but I heard there is another shortcut to do that: Ctrl + I According a reference found in google, Ctrl + Shift + F is Reformat and Ctrl + I is Correct indentation. Is there any difference between them? or between Reformat and Correct indentation? If you press CTRL + I it will just format tabs/whitespaces in code and pressing CTRL + SHIFT + F format all code that is format tabs/whitespaces and also divide code lines in a way that it is visible without horizontal scroll. RAS Ctrl + Shift + F formats the selected line(s) or the whole source