21

Is there any way to remove the line numbers when using the ace editor?

Similar to removing the print margin as shown below?

editor.setShowPrintMargin(false);
1
  • @epascarello perfect thxs. Wanna add as an answer so i can accept it? Feb 2, 2015 at 17:38

3 Answers 3

33

Use

editor.renderer.setShowGutter(true/false);

http://ace.c9.io/#VirtualRenderer.setShowGutter=&nav=api&api=virtual_renderer

Editor Options https://github.com/ajaxorg/ace/wiki/Configuring-Ace

27

If you want to hide the line numbers but keep the gutter for the folding widgets:

editor.renderer.setOption('showLineNumbers', false);
1
  • 3
    It is now: editor.setOption('showLineNumbers', false); Jun 14, 2019 at 0:33
10

Updating the answer for version 1.4.7. You can set multiple options for ace editor like this, including showGutter

this.editor.getEditor().setOptions({
    enableBasicAutocompletion: true,
    enableSnippets: true,
    enableLiveAutocompletion: true,
    showGutter: false,
    maxLines: 20
  });
1
  • Wonderful answer. Thank you Oct 18, 2020 at 20:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.