indent

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

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

Set 4 Space Indent in Emacs in Text Mode

I've been unsuccessful in getting Emacs to switch from 8 space tabs to 4 space tabs when I'm using Text mode. I've tried to edit my .emacs file to: (setq-default indent-tabs-mode nil) (setq-default tab-width 4) ;;; And I have tried (setq indent-tabs-mode nil) (setq tab-width 4) No matter how I change my .emacs file (or my buffer's lo...

Looking for a more flexible tool than GNU indent

When I run indent with various options I want against my source, it does what I want but also messes with the placement of *s in pointer types: -int send_pkt(tpkt_t* pkt, void* opt_data); -void dump(tpkt_t* bp); +int send_pkt(tpkt_t * pkt, void *opt_data); +void dump(tpkt * bp); I know my placement of *s next to the type not t...

Indenting styles

What are the different kinds of indent style in use? Are there any objective differences? How do you determine the indent style for a whole development shop? The indent style that I use is the so-called BSD KNF style or Kernel Normal Form. It's for me the most logical way of formatting my code. For instance: //I also prefer one tab per...

Changing Vim indentation behavior by file type

I have done some googling and I'm surprised that I haven't found this. COuld someone explain to me simply the easiest way to change the indentation behavior of vim based on the file type? For instance if I open a python file it would indent with 2 spaces, but if I open powershell it would use 4 spaces. ...

How do I indent multiple lines quickly in vi?

Should be trivial, and it might even be in the help, but I can't figure out how to navigate it. Thanks in advance. ...

SQL Statement indentation good practice

Hi, What is the accepted practice for indenting SQL statements? For example, consider the following SQL statement: SELECT column1, column2 FROM table1 WHERE column3 IN ( SELECT TOP(1) column4 FROM table2 INNER JOIN table3 ON table2.column1 = table3.column1 ) How should this be indented? Many thanks. ...

Annoying vim (un)indent rules

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

How to indent a selection in gvim (win32)?

I'd like to indent a block of text. I am able to do this in the linux build of givm. I do this is the state of gvim where I'm not in the insert or visual mode. The bar at the bottom is blank on the left and the line number, percentage are showing on the right hand side. Then I perform the following procedure: I select a block of text...

Vim indentation for c++ templates?

Does anyone have or know about vim plugin/macro/function that indents nicely c++ templates? When I highlight template definition in vim .hpp/.h file and indent it with '=' I get something like this: > template < > class TFilter, > class TParser, > class TConsumer, > class TDataProce...

Indent style names

I've seen this questions here. I'm wondering if there exists an offical name for the following indent style: void fooBar(String s) { while (true) { // ... do something } } When the opening brace is in the same line as the control statement, the statments within are indented and the closing brace is on the same iden...

Python. How to remove tab indent from several lines?

If you want to indent several lines in Python you just mark the lines and hit Tab. But what if you want to remove the indent from several lines? Is there a quick way to do that? Thanks edit: I use IDLE. ...

Any Emacs command like paste-mode in vim?

When i'm trying to paste some code from browser to Emacs, it will indent code automatically, is there any way to stop Emacs from indenting temporarily like :set paste in vim? ...

Question about HTMLTidy in Notepad++

How do I make it so that instead of indenting my elements by multiples of 2 spaces (when formatting without wrapping is selected), HTMLTidy indents them by multiples of tabs (4 spaces long but only 1 byte in size)? ...

How do I make vim indent JavaScript in HTML?

Vim 7.0.237 is driving me nuts with indentexpr=HtmlIndentGet(v:lnum). When I edit JavaScript in a <script> tag indented to match the surrounding html and press enter, it moves the previous line to column 0. When I autoindent the whole file the script moves back to the right. Where is vim's non-annoying JavaScript-in-HTML/XHTML indent? ...

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 want any source code I type to cause it to re...

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 Exception { ByteArrayOutputStream s; Docum...

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> </body> And "test.inc": <p>This is a test</p> <div> <p>This i...

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

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' test ':' suite)* ['else' ':' suite] suite: s...