0

Im sorry I'm really lacking the correct word to describe my problem. Basically in notepad++, when Im writing code, the parenthesis dont open and close neatly, all the characters on a new line start right at the beginning, make the code harder to read. I want it to be like this:

public class Program
{
    if (something)
    { code }
}

with the indent when code is inside more code, but instead it looks like this:

public class Program
{
if (something)
{ code }
}

Thanks.

`

user2903379
  • 375
  • 3
  • 22

2 Answers2

1

Once you start a new line, to indent you just need to press the Tab key. Each line under that line will be indented until you hit the backspace key.

Tab = Indent
Backspace = Remove Indent

Mike Stratton
  • 463
  • 1
  • 7
  • 20
  • But why doesnt it add it automatically like Visual Studio does? In VS, if I type { then it will automatically indent it. – user2903379 Apr 18 '15 at 23:31
  • Notepad++ is a simplistic code editor. It was created with minimal features to allow a programmer to hack out a few lines of code without having to wait for the entire IDE (VS for example) to load into memory. – Mike Stratton Apr 18 '15 at 23:35
  • Also, what @sємsєм said is true. If you save the file as a specific language type, PHP for example, it will auto indent. – Mike Stratton Apr 18 '15 at 23:41
0

Simply check the file type that you are editing. For, example, plain text (i.e .txt) does not support indent, while .php file support it. This mean that you have to save the file in extension supports indent.

enter image description here

enter image description here

SaidbakR
  • 13,303
  • 20
  • 101
  • 195