Customizing universal tab-size

We strongly recommend you to search the forum with possible keywords before making a new feature request. If your request is very similar to an existing one, consider liking it and/or making a comment rather than making a new one. Once you’ve searched and determined that this is a new request, delete this line.

Use case or problem

I would like to have a smaller tab-size, especially within code blocks. Right now, I believe we have a default 4-char long tab-size.

Proposed solution

A property, perhaps on the general preferences, to set the tab-size for whatever number of characters.

Current workaround (optional)

Using spaces instead of tab - which is far from ideal, once we can update them all automatically if needed as we would be allowed to if we had this general, universal tab-size parameter.

Related feature requests (optional)

Nothing that I can think of… couldn’t find anything explicitly related to this. Sorry!

4 Likes

Obsidian already has settings

  "useTab": false,
  "tabSize": 2,

but it’s hardcoded to insert 4 spaces regardless of the variable tabSize

Fixed that in Plugin: Fix Tab Size

Markdown defines indents as 1 tab or 4 spaces. Using a different number of spaces will cause problems with sub lists and any other Markdown structures that use indentation. Changing the visual display of tabs won’t.

Markdown indentation is more complicated than I remembered. Using a different number of spaces may or may not cause issues; there is discussion in this Discord thread: Discord

If I remember right, the setting used to affect the number of spaces and was later changed to the hard coded value. There may be discussion about it in some other thread.