indentation

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 than you might have. I do so in hopes that ot...

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

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

Indenting in Codegear

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

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 Indentation, it tries to force its way, while Vi is...

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',"btn_13_9_13"), ('matchNo',"13")]) ...

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. Now, I use (4) spaces for every indent le...

vim / vi / linux: properly indent html file

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

Looking for a PHP Indentation tool?

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

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 (which I am using for actionscript 3), it alwa...

Setting up your editor: indentation and encoding

Hi there, 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 programming editors so indentation and e...

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 templates don't match my beloved indentation and whitespac...

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 = some_function( bar, baz, function():vo...

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: <?php # main() /* * * */ { $fpath="...

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

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

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></table></div> into this: <div> <table> <tr> <td> <?php echo 'eart...

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

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 automatically formatting the indentations f...

Proper perl switch formatting in emacs

Edit: After reading the responses, I believe the answer is "don't do this", hence I marked an appropriate response as the official answer. Is there an easy way to get emacs to display perl switch statements like perldoc.perl.org's switch page? Here's the formatting on perldoc.perl.org: use Switch; switch ($val) { case 1 ...