How to remove indentation on newline


#1

Does anyone know how to remove indentation on newline event?

My current config is:

{ lineNumbers: true, mode: "javascript", smartIndent: false, tabSize: 2 }

When i enter

function() {
  alert("test");

then press enter, the newly added line will keep the indentation of two spaces.
However i want every line to start with zero indentation when i press enter.

How to achieve this?

Thanks in advance
Benjamin


#2

Bind Enter to a command like cm => cm.replaceSelection("\n") rather than the default, the newlineAndIndent command.


#3

perfect, thx!