Search code examples
ace-editorline-numbers

change ace editor line numbering to relative to cursor


Is it possible to change the line numbering of Ace Editor to show lines relative to current cursor position, such as in the following gif? Of course it does not need to be as pretty.

enter image description here


Solution

  • There is relativeLineNumbers option in the editor, which looks almost that pretty

    editor.setOption("relativeLineNumbers", true)