# JavaScript Formatting [edit]

This page explains how to turn off code formatting for specified blocks of JavaScript code.

## Introduction

The code formatting tool in Aptana allows you to turn formatting on or off for a pre-defined block of JavaScript code. The instructions below tell you how to designate whether formatting should be on or off for a block of code.

## Instructions

To turn formatting off or on for a block of JavaScript code:

- Use //noformat to signify the start of a block of code that the formatter should leave as is
- Use //format to signify that the formatter should resume formatting after the end of this comment directive
- If //noformat is never followed by a //format comment then the entire document after the //noformat comment will be left as is by the formatter
- //noformat and //format with any other content in those content blocks will be ignored as directives to the formatter
- //noformat and //format will be matched case insensitively (i.e //NOFORMAT and //Format will be interpreted as valid directives to the formatter)

Example:

    function test() {

    	//noformat
    		var i; var j; var k;
    	//format

    	i = 3;
    	while( i < 4 ) {
    		i++;
    	}
    }

## Related Topics

- Customizing your formatting preferences

Retrieved from "http://aptana.com/docs/index.php/JavaScript_Formatting"

Category: AptanaHelp