auto-indent

Change the Auto-Indent Lines setting when using Flutter in Android Studio

↘锁芯ラ 提交于 2019-12-23 21:50:09
问题 Problem Auto-Indent Lines improperly shifts indent of Redirecting constructors. The result of Auto-Indent is below. Project.getInbox()   : this.update(   foo: 1,   bar: 2,   baz: 3); The result I want is below. Project.getInbox() : this.update( foo: 1, bar: 2, baz: 3); Question How can I change the Auto-Indent Lines setting in Android Studio. Development Environment Android Studio 3.1.4 Tried → Error Tried : I checked "Preferences" -> "Code Style" -> "Dart" -> "Tabs and Indents" and "Wrapping

Vim: Use tabs for indentation, spaces for alignment with C source files

佐手、 提交于 2019-12-22 04:49:08
问题 Does anybody have her vim setup in a way that uses hard tabs as indentation characters, but does use spaces for alignment? The problem I have is that when starting a continuation line like in if (condition1 && (anotherlongcondition || /* <-- Here I insert a newline */ |-------|------- whatever /* some additional alignment added automatically */ , then cin (which is a must for me) adds some alignment just the way I prefer positionally , but this alignment is created using as much hard tabs as

What setting in vim counteracts smartindent's refusal to indent # comments in shell scripts?

為{幸葍}努か 提交于 2019-12-18 12:08:41
问题 I recently started using vim 7 (previously vim 6) and the smartindent setting. For the most part, it works well, though I'm so used to typing a tab after an open brace that it is almost counter-productive. However, there is one piece of maniacal behaviour. When editing a shell script, I try to create a comment at the current indent level, but smartindent will have nothing to do with it. It insists that the comment must be at level 0 (no indent). What's worse, it breaks shift-right (' >> ' and

Notepad++: disable auto-indent after empty lines

戏子无情 提交于 2019-12-18 10:48:42
问题 I find the autoindent style of Notepad++ a little weird: when I am typing on an indented line, I do want it to indent the next line after I press Enter (this it does properly). However, when I am on an empty line (no indentation, no characters) and I press Enter, it indents the next line, using the same indentation as the last non-empty line. I find this extremely annoying; have you ever encountered this problem and do you know how to fix it? (Note: I'm editing HTML/PHP files.) (Also,

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

橙三吉。 提交于 2019-12-18 09:07:21
问题 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> 回答1: 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

Turning off auto indent when pasting text into vim

ε祈祈猫儿з 提交于 2019-12-17 02:39:05
问题 I am making the effort to learn Vim. When I paste code into my document from the clipboard, I get extra spaces at the start of each new line: line line line I know you can turn off auto indent but I can't get it to work because I have some other settings conflicting or something (which look pretty obvious in my .vimrc but don't seem to matter when I take them out). How do I turn off auto indenting when I paste code but still have vim auto indent when I am writing code? Here is my .vimrc file:

How can I get gg=G in vim to ignore a comma?

喜夏-厌秋 提交于 2019-12-13 01:24:26
问题 I have autoindent and smartindent in vim turned on, but nocindent turned off. I'm trying to indent some JSON text without pretty-printing the whole thing, which would be too intrusive: { "a" : "value1", "b": "value2", "c": "value3", ... Gets formatted by gg=G as: { "a" : "value1", "b": "value2", "c": "value3", ... What's the logic going on there, and what options can I set to fix it, if it's possible? I tried toggling options like autoindent, smartindent, and cindent (with their "no"

Can VIM autoindent SQL?

痞子三分冷 提交于 2019-12-12 07:47:29
问题 "SQL Statement indentation good practice" appears to be the accepted format for writing SQL blocks. Is there a Vim indent/syntax file that would adhere to this standard, or at least be close? Currently my Vim left alights pretty much everything and only indents certain keywords. 回答1: "SQLUtilities : SQL utilities - Formatting, generate - columns lists, procedures for databases" has the SQL Utilities plugin, which is capable. And "How to auto-format and auto-capitalize SQL in Vim" is a related

Sublime Text isn't indenting properly with HTML

戏子无情 提交于 2019-12-11 10:04:46
问题 Related but not identical question: Sublime Text indentation behavior. I have seen many videos in which after the autocompletion of an HTML tag, pressing enter automatically results in the closing tag appearing two lines, and the cursor being properly indenting on the second line, between the opening and closing tabs. In my situation, the autoindent function in Sublime Text 2 seems to be working poorly. Here is exactly what happens (as can be seen in the below gif). Press tab after writing

Vs code auto indenting not working for python

折月煮酒 提交于 2019-12-11 01:34:37
问题 I’m new to visual studio code, just switched from sublime text 3. I was writing a simple if statement and when I write else: like that, on ST3 it would move the else to under if but this doesn’t happen with vscode. I’ve tried everything and looked everywhere but doesn’t seem to work. Any ideas of why? Or does vscode really lack this basic fundamental feature? 回答1: This is a known issue that requires a non-trivial implementation of a custom indentation provider. 来源: https://stackoverflow.com