indentation

Indenting Continuation Lines in Xcode

谁都会走 提交于 2020-01-24 05:03:26
问题 Can I get Xcode's automatic indentation to indent continuation lines? I want: BOOL someLongVariableName = someLongValue | someOtherLongValue | moreLongValues BOOL someOtherLongVariableName = someEvenLongerValue; [someLongVariableName performSomeAction:someLongArgument] I currently get: BOOL someLongVariableName = someLongValue | someOtherLongValue | moreLongValues BOOL someOtherLongVariableName = someEvenLongerValue; [someLongVariableName performSomeAction:someLongArgument] To be clear: I'm

Indenting Continuation Lines in Xcode

纵饮孤独 提交于 2020-01-24 05:03:15
问题 Can I get Xcode's automatic indentation to indent continuation lines? I want: BOOL someLongVariableName = someLongValue | someOtherLongValue | moreLongValues BOOL someOtherLongVariableName = someEvenLongerValue; [someLongVariableName performSomeAction:someLongArgument] I currently get: BOOL someLongVariableName = someLongValue | someOtherLongValue | moreLongValues BOOL someOtherLongVariableName = someEvenLongerValue; [someLongVariableName performSomeAction:someLongArgument] To be clear: I'm

Sublime Text (v 2.0) - how do I stop auto indentation on new lines after brackets?

六月ゝ 毕业季﹏ 提交于 2020-01-22 15:33:07
问题 I'm trying to make the jump from Notepad++ to Sublime Text 2. However one issue is stopping me from doing so: When working in CSS, JavaScript or PHP - whenever I type a bracket and press [ENTER], an extra indentation is added. E.g. below show's you where the caret ends up if I type a bracket and press enter: { | I need the caret to appear at the same horizontal point as the bracket, like so: { | I've tried messing with the indentation settings to no avail. Here are my current User Settings: {

Indent multiple lines quickly in vi

て烟熏妆下的殇ゞ 提交于 2020-01-18 04:31:59
问题 It should be trivial, and it might even be in the help, but I can't figure out how to navigate it. How do I indent multiple lines quickly in vi? 回答1: Use the > command. To indent five lines, 5 > > . To mark a block of lines and indent it, V j j > to indent three lines (Vim only). To indent a curly-braces block, put your cursor on one of the curly braces and use > % or from anywhere inside block use > i B . If you’re copying blocks of text around and need to align the indent of a block in its

Multiline string replace with pretty indentation

偶尔善良 提交于 2020-01-16 05:12:31
问题 I want to do multi-line string replacements in some template files, but retain a pretty indentation. Here's an example of the template: <TAG1> <TAG2> %REPLACETHIS% </TAG2> </TAG1> Now, when I simply replace the string %REPLACETHIS% with a string like <REPLACEDSTRINGTAG1> replacedstringtext </REPLACEDSTRINGTAG1> it will look something like: <TAG1> <TAG2> <REPLACEDSTRINGTAG1> replacedstringtext </REPLACEDSTRINGTAG1> </TAG2> </TAG1> when it should look like: <TAG1> <TAG2> <REPLACEDSTRINGTAG1>

Syntax confusion (do block)

删除回忆录丶 提交于 2020-01-16 04:37:19
问题 Sorry for a poor title, feel free to edit. I can't understand what the problem is, so it might be altogether wrong. Below is the code (this is after I've done like a hundred of permutations and different sequences of let-do-if and tabulation, and I'm exhausted): -- The last statement in a 'do' construct must be an expression numberOfGoods :: IO String numberOfGoods = do putStrLn "Enter year (2000-2012):\n" let intYear = readYear in if (intYear < 2000 || intYear > 2012) then error "Year must

Set tab as 2 spaces in vimrc, but still set to 4 spaces when editing python files

◇◆丶佛笑我妖孽 提交于 2020-01-15 06:01:27
问题 I've set tab to equal 2 spaces in my vimrc. This works when I edit java files, but for some reason when I edit python files, tab is set to 4 spaces instead. My vimrc: filetype plugin indent on syntax on set backspace=indent,eol,start set expandtab set tabstop=2 set shiftwidth=2 set softtabstop=2 set showtabline=2 set number set showcmd set cursorline set wildmenu set lazyredraw set showmatch call plug#begin('~/.vim/plugged') Plug 'scrooloose/nerdtree' Plug 'drewtempelmeyer/palenight.vim' Plug

In C#, how do I convert a XmlNode to string, with indentation? (Without looping)

为君一笑 提交于 2020-01-13 07:41:10
问题 This has got to be such a simple question but I just can't get the answer. I have an XmlNode and all I want to do is output this node, as a string, with indentations (tabs or spaces) intact to provide better readability. So far I tried XmlWriter, XmlTextWriter, XmlDocument, XmlReader. I tried the PreserveWhitespace in XmlDocument but I couldn't get the XmlDocument to output my node. I tried the Formatting = Formatting.Indented property in XmlTextWriter but I couldn't figure out how to output

Indenting heredocs with spaces [duplicate]

不问归期 提交于 2020-01-11 17:42:08
问题 This question already has answers here : here-document gives 'unexpected end of file' error (5 answers) Closed 4 months ago . For personal development and projects I work on, we use four spaces instead of tabs. However, I need to use a heredoc, and I can't do so without breaking the indention flow. The only working way to do this I can think of would be this: usage() { cat << ' EOF' | sed -e 's/^ //'; Hello, this is a cool program. This should get unindented. This code should stay indented:

Vim textwidth comma indent problem

时光总嘲笑我的痴心妄想 提交于 2020-01-10 19:30:10
问题 If i set the following option in Vim, set textwidth=80 the text will break at 80 characters. This works, but the problem is if a comma (,) is on the end of a line, Vim indents the next line. What can I do to avoid this behaviour? 回答1: You probably have C style indenting on. :set nocindent should do the trick 回答2: Edit your .vimrc and comment set fo=... out. 来源: https://stackoverflow.com/questions/1516054/vim-textwidth-comma-indent-problem