How to configure CodeMirror


I want gogs web editor to use Tabs when editing XML files online.
(currently when the user press Enter in the text area, a new line is created with space indentations, regardless of the indentation style already used by the file)

Searching about that, I feel it comes down to configuring CodeMirror setting ‘indentWithTabs’ to true

But I wasn’t able to figure out how to do this configuration through gogs (using custom/templates ?), preferably without recompiling gogs.

Ideally if there is a way to change this settings based on the file type… but if it’s globally set to true, it’s fine with me.


Hi, I think you’re able to use EditorConfig in your repository root directory to control this behavior.

indent_style = tab:

Thanks, I’ve seen that possibility.

However this is not a code repository…
This repository only contains XML configuration files, so I would like to avoid adding a .editorconfig file there.
If there is an alternate solution…

editorConfig is meant to be used by editor, which is not necessarily to edit code.