indentation

Properly indent KnockoutJS virtual elements

你离开我真会死。 提交于 2019-12-22 05:15:58
问题 I just started work on a large KnockoutJS code base in a Visual Studio MVC project. Everything so far seems fairly straightforward except the virtual elements. I understand the need and it is fairly nifty. However because the virtual elements are comments then indentation is all messed up which makes it a terrible pain to read. Is it possible to convert these to an actual html element or to get Visual Studio/Resharper to indent them correctly? For instance I have some code like the following

Why won't IntelliJ use tabs?

馋奶兔 提交于 2019-12-22 04:54:29
问题 As per How can I use tabs for indentation in IntelliJ IDEA?, I have gone through and set each extension to "Use tab character" as seen below. It doesn't work though - IntelliJ is still inserting spaces when I hit the tab button. Did I miss something? Where is intelliJ's [Please use tabs like I ef'ing told you to do] button? (FYI, I'm using IntelliJ Ultimate 2016.2) This looks promising... ... but apparently it's all lies :( 回答1: Maybe you have the option Settings->Editor->General->"Allow

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

Emacs custom indentation

ぐ巨炮叔叔 提交于 2019-12-22 04:01:21
问题 My team uses a special type of file for configuration, and I would like to auto-indent (block indent) the file using emacs. I would like to increase the indentation by a tab size for an opening parenthesis - { or [, and decrease by a tab size for a closing parenthesis - } or ] . For example, files = { file1 = first_file.txt file2 = second_file.txt rules = { skip_header = 1 fast_process = 1 } } C-style indentation doesn't work since a line doesn't end with semi-colon. I have studied about

Annoying vim (un)indent rules

馋奶兔 提交于 2019-12-22 03:51:12
问题 When editing PHP code (I'm not sure if it's specific to that language) and I create a new line in the middle of comma-separated lists that span multiple lines, the indent rules always unindent the line I'm leaving. Here's a video of it. This happens in arrays, function argument lists, etc. Is there anything I can do to stop this from happening, or any quicker methods of fixing the error than moving up, re-indenting it, moving down, re-indenting (since it gets cleared when you leave the line),

php: auto indent the whole code?

。_饼干妹妹 提交于 2019-12-22 03:49:05
问题 isnt there any software/plugin to netbeans/eclipse that auto indent the whole code after i've inserted it? not just indent when i press ENTER for new function. i want to paste in a code for example without indents and it will auto indent everything automatically since it can recognize what language is used. should save a lot of time. 回答1: In Zend Studio (and I guess in Eclipse with PDT as well), you can right click your pasted document in the editor view and select Source Format . Rules for

How to create an all browser-compatible hanging indent style in CSS in a span

 ̄綄美尐妖づ 提交于 2019-12-22 01:12:44
问题 The only thing I've found has been; .hang { text-indent: -3em; margin-left: 3em; } The only way for this to work is putting text in a paragraph, which causes those horribly unsightly extra lines. I'd much rather just have them in a <span class="hang"></span> type of thing. I'm also looking for a way to further indent than just a single-level of hanging. Using paragraphs to stack the indentions doesn't work. 回答1: <span> is an inline element. The term hanging indent is meaningless unless you're

AutoIndent for JavaScript in Vim that understands Semicolon Insertion

扶醉桌前 提交于 2019-12-21 14:33:26
问题 I don't end my JavaScript statements with semicolons when newlines will work. No flames, please. My question is, is there an automatic indentation package for vim that will work? Here is an example of how dumb it is: $(function(){ var foo // code starts here, // The following line breaks things, but adding a comment to it fixes things ({a:1}) var foo // everything is stuck left now. ({a:1}) var foo // previous line justifies all following lines wherever you put it function flat(){ var foo //

Can Vim display two spaces for indentation, while keeping four spaces in the file?

爷,独闯天下 提交于 2019-12-21 07:33:18
问题 I want to work on someone else's project, and he uses 4 spaces for indentation. I use 2, and my screen is not big enough to edit using 4 spaces comfortably. Can I configure Vim to display 2 spaces for indentation, but write 4 to the file? 回答1: This is the opposite of what was asked here. Yes, you can! If you have the "conceal" option, you can try this out. :syntax match spaces / / conceal cchar= "Don't forget the space after cchar! :set concealcursor=nvi :set conceallevel=1 Here are what

Emacs org-mode python blocks have 5 space tabs, but I want 4 space tabs

ε祈祈猫儿з 提交于 2019-12-21 05:01:02
问题 I'm writing python code inside source blocks within an org-mode file; I'm editing the code-block in a sub-buffer, in python mode using the emacs command C-c ' Example: #+begin_src python def function(x): hitting_tab_inserts_5_spaces=x*2 if x<0: hitting_tab_inserts_5_spaces=-x return x and I'm getting 5 space tabs everywhere, instead of the 4 space tabs that I want. Note: I have viper (vim emulation) on. Where in the configuration are the parameters that affect tabination inside codeblocks in