Notepad + Curly Bracket Auto-Outdenting

I personally believe that the general practice of javascript coding is as follows:

function(){ //code } 

is ugly and annoying. Therefore, when I encode javascript, I like to format it like this:

 function() { //code } 

I have never had this problem with notepad ++ before, but after my last installation, the program feels the need to remove my tab / indent every time I try to defer my curly braces, so I need to go back and click the tab again after both dialed. Does anyone know which preference option can fix this?

I found that if I go to Settings> Settings> MISC. and then uncheck the box that says "auto-indent", the program will stop deleting my indentation, but it also starts to change completely when I start a new line.

Just to summarize again. If my previous line of code was indented 3 times, I want it to still be indented 3 times when I press enter / return. I also want this to be when I indent my braces so that they stay where I indented them and not let go of one indent.

I spent a lot of time looking for this and didnโ€™t find out anything, and I canโ€™t figure it out by throwing preferences. If you could help me solve this problem, that would be greatly appreciated.

+6
source share
1 answer

I found a way to restore the previous behavior of Notepad ++ (before the release of version 6.7) , which do not impose a K & R;

  • Disable automatic indentation in advanced settings
  • Install NppAutoIndent Plugin
  • Install NppAutoIndent with the "Previous Line" option if you like the Allman style or the "Block Indent" if you prefer the Whitesmiths style (as requested by @Shikayaru).

Nb: NppAutoIndent's Smart Indent option applies the same default behavior to Notepad ++ from 6.7 (and applies only to the K & R style).

I requested (by mail) the ability to disable this new feature introduced with Notepad ++ 6.7, but I never get an answer. Someone created a problem on GitHub that you can support; https://github.com/notepad-plus-plus/notepad-plus-plus/issues/296

+4
source

Source: https://habr.com/ru/post/981603/


All Articles