indentation

How to replace all tab characters in a file by sequences of white-spaces in intellij?

社会主义新天地 提交于 2019-12-03 04:54:19
问题 Given a file in my project, I want to be able to replace all of the tab characters in the file with white spaces. Is there any way to do this in intellij? 回答1: Go to Edit | Convert Indents , and then choose To Spaces or To Tabs respectively. It's in the documentation: Changing identation 回答2: Replace only tabs used for indentation Ctrl + Shift + A type "To Spaces" > Enter Replace all tabs Ctrl + R check Regex Enter \t and spaces Replace all 来源: https://stackoverflow.com/questions/25816516/how

Vim: Smart indent when entering insert mode on blank line?

前提是你 提交于 2019-12-03 04:11:58
问题 When I open a new line (via 'o') my cursor jumps to a correctly indented position on the next line. On the other hand, entering insert mode while my cursor is on a blank line doesn't move my cursor to the correctly indented location. How do I make vim correctly indent my cursor when entering insert mode (via i) on a blank line? 回答1: cc will replace the contents of the current line and enter insert mode at the correct indentation - so on a blank line will do exactly what you're after. I

If you break long code lines, how do you indent the stuff on the next line?

一个人想着一个人 提交于 2019-12-03 04:06:48
问题 Sometimes you have to write in your source long lines, that are better to break. How do you indent the stuff ceated by this. You can indent it the same: very long statement; other statement; That makes it harder to differentiate from the following code, as shown in the example. On the other hand you could indent it one level: very long statement; other statement; That makes it easier, but it can happen, that the long line is the start of a nested block, that you want to indent, like this: if

Showing trailing spaces in vim

不羁的心 提交于 2019-12-03 03:01:16
问题 I've set the following options in .vimrc set listchars=tab:▸\ ,trail:· set list And expected to see dots in those places where spaces are used for tabulation in the code (I use spaces, not tabs). However, the result is different: Could you please recommend how to reach the desired result? Thanks! 回答1: You should check this link. I'm using the match command solution : :highlight ExtraWhitespace ctermbg=red guibg=red :match ExtraWhitespace /\s\+$/ This page also provides list based solutions

XCode 3.2: Changing the default “Code Sense” indentation and whitespaces

柔情痞子 提交于 2019-12-03 02:52:01
问题 I'm working with XCode 3.2 (on "Snow Leopard") which (still) has this nice "Text Macro" auto-completion feature (eg. if you type if it will expand to if (<#condition#>) { <#statements#> } ). These macros are also available via "Edit->Insert Text Macro". Unfortunately, the default templates don't match my beloved indentation and whitespace style so I'd like to modify them. According to this slightly outdated StackOverflow thread the corresponding definitions should be located at /Developer

Vim formatting using gg=G with xml

六月ゝ 毕业季﹏ 提交于 2019-12-03 02:42:39
I have a correctly formatted xml file, and following the command given as an answer here: How can I autoformat/indent C code in vim? I am trying to auto indent my file to display correct nesting. Before I tried to use this command I set the file type to xml using :set ft=xml as the file I started with has an extension of .mm , and also :set nowrap . Here is my ~/.vimrc file: syntax on set history=1000 set smartindent set tabstop=2 set shiftwidth=2 set expandtab How come when I issue gg=G , I get a message saying 54 lines indented , yet my file remains un-nested? in case you wanna try Vim's own

How to remove tab indent from several lines in IDLE?

て烟熏妆下的殇ゞ 提交于 2019-12-03 02:38:47
问题 If you want to indent several lines in Python IDLE you just mark the lines and hit Tab. But what if you want to remove the indent from several lines? Shift+Tab does not work for that in IDLE. 回答1: If you're using IDLE, and the Norwegian keyboard makes Ctrl-[ a problem, you can change the key. Go Options->Configure IDLE. Click the Keys tab. If necessary, click Save as New Custom Key Set. With your custom key set, find "dedent-region" in the list. Click Get New Keys for Selection. etc I tried

How can I use tabs for indentation in IntelliJ IDEA?

泄露秘密 提交于 2019-12-03 02:30:57
问题 How can I use tabs instead of multiple spaces for indentation in IntelliJ IDEA 11.0? I have "Use tab character" checked under "Code Style" > "General" > "Default Indent Options". And also tried to have "Smart tabs" checked, but it doesn't help. From the documentation: If this check box is selected, tab characters are used: On pressing the Tab key For indentation For code reformatting Otherwise, spaces are used instead of tabs. 回答1: IntelliJ IDEA 15 Only for the current file You have the

Indentation shortcuts in Visual Studio

人走茶凉 提交于 2019-12-03 01:37:52
问题 I'm new to Visual Studio 2010 and C#. How can I indent the selected text to left/right by using shortcuts? In the Delphi IDE the equivalents are Ctrl + Shift + I and Ctrl + Shift + U 回答1: Tab and Shift + Tab will do that. Another cool trick is holding down ALT when you select text, it will allow you to make a square selection. Starting with VS2010, you can start typing and it will replace the contents of your square selection with what you type. Absolutely awesome for changing a bunch of

Emacs indentation difficulty

孤人 提交于 2019-12-03 01:27:08
I'm really trying to switch to emacs, but learning to setup the environment is a real pain. Everybody says it's worth it, so I just continue. I want my c code to be implemented that way: if(asdf) { asdr = 1; } Depending on the current standard (I know, don't get me started), could be: if(asdf) { asdr = 1; } I can't seem to change the indentation size from 2, it always looks like the GNU standard: if(asdf) { asdr = 1; } , which I dislike. Here is what I have put in my .emacs: ; Warn in C for while();, if(x=0), ... (global-cwarn-mode 1) ; no electric mode in c (c-toggle-electric-state -1) ;