Disabling Indentation and Auto Closing Brackets in Notepad++

notepad

Right now Notepad++ is automatically adding closing brackets as well as automatically indenting my code. (PHP)

It's doing this differently from how the code I'm working with is indented.

Is there a way I can do the following?

  • Disable automatic indentation where it changes the indentation, but keep the indentation where it continues the existing?
    (so if I am indented 3 places and press enter, I'll be indented 3 places on the new line, but if I open a bracket, I'll STILL be indented 3 places)
  • Disable automatic bracket closing entirely

(I don't have any options under the auto-complete section checked).

Best Answer

First of all the automatic bracket completion is easy. Just go to Settings >> Preferences >> Auto Completion and uncheck the parentheses, brackets, and curly brackets from the list as shown in the following picture. This will stop auto completion of those brackets.

Uncheck braces

Second for the auto indentation, you will have to use a workaround. If you go into Settings >> Preferences >> MISC. you will find an option for auto indent. However in my experience that will not stop auto indentation for php. The workaround is a plugin called NppAutoIndent. You can download this from the plugin manager (Plugins >> Plugin Manager >> Show Plugin Manager). After you download it, go to Plugins >> NppAutoIndent and check Previous Line and make sure Ignore Language is unchecked. See the pitcure below for clarity.

enter image description here

I hope this helps you and if not feel free to comment! God Bless and have a great day!

Related Question