Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notepad++ auto indention after opening curly bracket

So what I would like to get is this :

public function someFunc()
{
    //start typing from here
}

after I type opening curly bracket and press enter, I want notepad++ to make a new line and indent it by one tab, and then close the curly brace in next line after it, something like netbeans have.

I am using XBrackets Lite plugin for autocompleteing brackets, but that plugin does not provide auto indention in new line, it just close the brackets on the same line like this :

public function someFunc()
{
}

I need this behavior for both php and javascript.

Can some one help me please ?

like image 827
Anita Avatar asked Oct 26 '25 20:10

Anita


2 Answers

Welcome to StackOverflow! The Notepad# has such a feature, try this plugin out.


[OFF]

Another hint: try WebEdit plugin, too. You can create your own word list (Plugins > WebEdit > Edit Config) to boost up your work. (It is recommended to comment out the default values of [Commands], [Toolbar] and [Tags], like ;1=a.bmp). Some ideas:

p=public function |() {\n\i\n}
r=require("|.php");
io=include_once("|.php");
l=console.log(|);
etc.
like image 71
Stocki Avatar answered Oct 29 '25 06:10

Stocki


JSTool plugin does that.

In order to install it, go to menu: Plugins - Plugins Admin... Then mark JSTool to install and install it.

After installation go to menu: Plugins - JSTools - JSFormat (Ctrl+Alt+M) and the text should be reformatted.

like image 26
Luker Avatar answered Oct 29 '25 07:10

Luker