Все вопросы: [indentation]

100 вопросов

похожие теги: auto-indenttext-indent
2
голосов
4ответов
2407 просмотров

Controlling Output Indentation in ASP.Net MVC

My colleague is extremely 'hot' on properly formatted and indented html being delivered to the client browser. This is so that the page source is easily readable by a human. Firstly, if I have a partial view that is used in a number of different areas in my site, should the rendering engine be a...

43
голосов
4ответов
14362 просмотров

How to display indentation guides in Emacs?

I'm trying to switch to Emacs as my primary source-code editor. I really miss one thing (common in even much simpler editors) - indentation guides (unobtrusive vertical lines which show the indentation level). Is Emacs able to display them?

0
голосов
1ответов
157 просмотров

Copy of "Format Document" function in Visual Studio?

I am looking for an app that can do what the "Format Document" function does in Visual Studio. Something really stupid (maybe even an add-on to a normal text editor) that will basically turn this: <div><table><tr><td><?php echo 'earth'; ?></td></tr></...

6
голосов
4ответов
863 просмотров

Vim indenting file for Treetop (Ruby parser)

Has anyone seen a vim indent file for treetop, the Ruby parser/generator? I've found a vim syntax highlighting file, but haven't seen one for indentation.

10
голосов
1ответов
3514 просмотров

How do I parse indents and dedents with pyparsing?

Here is a subset of the Python grammar: single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE stmt: simple_stmt | compound_stmt simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE small_stmt: pass_stmt pass_stmt: 'pass' compound_stmt: if_stmt if_stmt: 'if' test ':' suite ('elif' tes...

39
голосов
2ответов
25027 просмотров

How to write an empty indentation block in Python?

The runtime keeps telling me: expected an indented block But I don't want write nothing inside my except block, I just want it to catch and swallow the exception.

8
голосов
2ответов
1579 просмотров

Vim textwidth comma indent problem

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?

0
голосов
1ответов
1012 просмотров

Emacs not indenting PHP correctly, although C/C++ do?

I am running GNU Emacs 22.2.1 on a HP notebook running Ubuntu 9.04 with the latest patches. Recently, I need to handle some PHP codes, so I added Ubuntu's php-mode package, thinking what I have in my .emacs would cover the basics. Well, almost. The following short snippet shows the symptom: ...

0
голосов
2ответов
776 просмотров

Emacs Actionscript 3 indentation for functions defined inline in an arglist

I'm using the actionscript-mode-connors.el for indenting Actionscript 3 code in emacs. I have most things figured out, but one thing bothering me is when I use an inline closure as a function argument, the indentation of the interior of the function is screwed up. For example: var foo:int = so...

11
голосов
2ответов
2599 просмотров

XCode 3.2: Changing the default "Code Sense" indentation and whitespaces

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 t...

0
голосов
3ответов
191 просмотров

Setting up your editor: indentation and encoding

I'm developing a small project with some friends and we're facing some indentation issues. Each of us is using a different editor (we all have different favorites :) and we also are on different operating systems. What is the best solution to be able to all develop together and set our programmi...

19
голосов
3ответов
4877 просмотров

How to control indentation after an open parenthesis in Emacs

When I use emacs python-mode, if the last character of a line is an open parenthesis it indents the next line just one step in from the indentation of the previous line. call_some_function( some_very_long_argument_that_I_want_to_put_on_its_own_line) I like that. Now in ecmascript-mode (whi...

1
голосов
3ответов
1786 просмотров

Looking for a PHP Indentation tool?

Is there something like the "phpCodeBeautifier" from waterproof that is open source?

10
голосов
3ответов
5646 просмотров

vim / vi / linux: properly indent html file

how can I easily indent html files with linux or vi or vim.

6
голосов
1ответов
1840 просмотров

How do I emulate Vim's 'softtabstop' in Emacs?

I've been trying to get into emacs lately, and one of the things I need to get right is indentation. Example 1: sub foo { my $bar = 'quux'; | Example 2: sub foo { my $bar = 'quux'; |# foo Imagine that the pipe character in the above examples indicates the cursor position....

-1
голосов
2ответов
293 просмотров

python help needed

import os import sys, urllib2, urllib import re import time from threading import Thread class testit(Thread): def __init__ (self): Thread.__init__(self) def run(self): url = 'http://games.espnstar.asia/the-greatest-odi/post_brackets.php' data = urllib.urlencode([('id...

3
голосов
2ответов
861 просмотров

How can I code in C++ with the same indentation style both in Vi and Emacs?

How can two developers work on a same C++ code base such that they can work transparently ? Is there any common indentation style for C++ code such that once it is established, the two developers can produce code with the same indentation level. I have found Emacs very aggressive for Indentati...

8
голосов
3ответов
9508 просмотров

How can I make a php script add a tab to every line of an include file?

Within my HTML, I have a php script that includes a file. At that point, the code is indented 2 tabs. What I would like to do is make the php script add two tabs to each line. Here's an example: Main page: <body> <div> <?php include("test.inc"); ?> </div>...

112
голосов
7ответов
106347 просмотров

Java: How to Indent XML Generated by Transformer

I'm using Java's built in XML transformer to take a DOM document and print out the resulting XML. The problem is that it isn't indenting the text at all despite having set the parameter "indent" explicitly. sample code public class TestXML { public static void main(String args[]) throws Excep...

1
голосов
1ответов
888 просмотров

Indenting in Codegear RAD Studio

Is there a way to indent/tab multiple lines in one action in the Codegear RAD Studio IDE? i.e. I would like to be able to highlight multiple lines and indent them all by one tab simultaneously.

19
голосов
2ответов
4035 просмотров

How to I configure emacs in java mode so that it doesn't automatically align method parameters

In emacs, when I type: public void foo(String one, String two) { It tabifies like this: public void foo(String one, String two) { I'd rather it didn't, and just aligned parameters like other line continuations. How can I configure it not to do this?

5
голосов
2ответов
1777 просмотров

How do I tell /usr/bin/indent on Mac OS X 10.5 to format my C code K&R style?

On Linux I am used to running indent -kr ... to indent C files. /usr/bin/indent on Mac OS X 10.5 does not support the -kr option. Does anyone have a ~/.indent.pro file that would produce results closest to K&R style? Thanks!

4
голосов
2ответов
730 просмотров

Make Emacs less aggressive about indentation

Emacs reindents the current line whenever I type certain things, like ";" or "//". This is pretty annoying, since there are a whole lot of places where it isn't smart enough to indent correctly. How do I disable this feature? I still want to be able to indent the line with TAB, but I don't wan...

15
голосов
4ответов
3222 просмотров

Smart Indent algorithm documentation?

I'm a big fan of documenting the proper behavior of IDE features that have a subtle but significant impact on coding flow - things like auto-completion selection and commenting/uncommenting code you might not realize you take advantage of but at the end of the day you got just a bit more done tha...

148
голосов
10ответов
272678 просмотров

How do I autoindent in Netbeans?

In eclipse you can click Ctrl+I at any line, and it'll automatically indent the line or group of lines according to the indentation scheme you chose in the settings. I'm really missing this feature in Netbeans. Is there any equivalent feature? I'm aware of Alt+Shift+F but it's not good enough. ...

4
голосов
2ответов
1459 просмотров

Indentation problem in f# (vs2010 beta1)

I'm just learning f# so possibly I'm doing something very silly. Feel free to point me to the relevant documentation, I've searched but wasn't able to find. I am using Visual Studio 2010 beta on windows 7 (.Net 4.0). Everything is going well with my first f# project. Well.. almost everything. In...

3
голосов
3ответов
1998 просмотров

Objective-C indentation in emacs

I'm using Emacs to edit my Objective-C code. The default indentation looks like this: NSTimer *timer = [NSTimer timerWithTimeInterval:1.0 target:self selector:@selector(callback:) userInfo:nil repeats:YES]; I wou...

2
голосов
2ответов
249 просмотров

Can all language constructs be first-class in languages with offside-rules?

In LISP-like languages all language constructs are first-class citizens. Consider the following example in Dylan: let x = if (c) foo(); else bar(); end; and in LISP: (setf x (if c (foo) (bar))) In Python you would have to write: if c: x = foo(); els...

6
голосов
4ответов
3042 просмотров

Indenting CSS in emacs

So emacs's auto-indentation for CSS is driving me batty. Here is what I like CSS to look like: #foo ul.bar { .... } #foo ul.bar li { .... } #foo ul.bar li a { .... } This is what emacs gives me with its auto-indentation: #foo ul.bar { ......

4
голосов
6ответов
23474 просмотров

AutoIndent in Eclipse possible?

I have been wracking my brain trying to figure this out. For the first time I used jEdit the other day and I was pleasantly surprised that it auto indented my code (meaning that I'd put in the following code: int method () { _ //<-- and it put me here automatically I've tried to get the...