Here's my quick and dirty solution. Really it just involves creating a macro along with enabling a XML tools feature.
First, remove the "Indent By Fold" plugin, if installed.
Then, enable the "Tag auto-close" feature by going to Plugins>XML Tools.
Also, enable Notepad++'s auto indent by going to Settings > Preferences > MISC. Tab
Next, go to Macro > Start Recording.
Now, hit the following keys in this sequence:
>, enter, enter, up, tab.
Then, go to Macro > Stop Recording. Followed by, Macro > Save Current Recorded Macro.
This will create the final '>' as well as the closing tag, but then leave your cursor indented in a new line between the opening and closing tags.
I saved mine as "CTRL + '.'".
The reasoning behind this was that if I was here:
<hello|
The natural thing to do would be to hit the '>' key. Since I need to hit SHIFT+ '.' on a QWERTY keyboard to get this character, I figure I'd use CTRL+'.' (only one key away) to perform the macro and save SHIFT+'.' for cases where I just want the plain old character (e.g. <hello />
).
Here is the result after hitting CTRL + '.'
<hello>
|
</hello>
I'll be on the lookout for a more elegant solution, but for now this seems to be pretty good.
Hope this helps!
I need to remove one level of indentation when coding
I use a variety of text editors such as Geany, N++, gedit, and Code::Blocks
Notepad++
Select the lines you want to "unindent" and press shift+tab
Geany
Select the lines you want to "unindent" and press shift+tab or ctrl+u
gedit
Select the lines you want to "unindent" and press shift+tab
Codeblocks
Select the lines you want to "unindent" and press shift+tab
Best Answer
You can use TextFX plugin to reindent code for you. If you don't have it, you will need to install in from your plugin manager. Once in place > just use the menu "TextFX" > "TextFX Edit" > "Reindent C++ code".
Probably it won't convert a single line, but actual code with miss-indentations will be handled well.
You will find more info and other plugins explained here.