How to remove indentation on newline


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() {

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


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


perfect, thx!