by leondgarse
Make Tab indent by 2 spaces and Shift+Tab unindent by 2 spaces.
Indent with Spaces
Since Obsidian 1.8, pressing Tab with Indent using tabs turned off always inserts 4 spaces. The Tab indent size setting only controls how wide a tab character is displayed.
This plugin makes Tab indent by 2 spaces and Shift+Tab unindent by 2 spaces. The number of spaces can be changed in Settings → Indent with Spaces → Spaces per indent (1–8).
Behavior
- Tab on a list item, or with the cursor in a line's leading whitespace: adds the indent at the start of the line.
- Tab with several lines selected: indents every selected line, for example to move a whole code block under a list item.
- Tab in the middle of plain text: not handled, so Obsidian or another plugin gets it.
- Cells of Live Preview tables: not handled, so Tab / Shift+Tab move between cells as usual.
- Shift+Tab: removes up to one indent of leading spaces (or one tab) from each selected line.
- Tables (lines starting with
|, indented or not): if Advanced Tables is enabled, Tab / Shift+Tab run its Next cell / Previous cell commands. These also work in Live Preview, where Advanced Tables' own Tab binding is turned off, and Tab on a header-only row inserts the| --- |delimiter row. Without Advanced Tables, Tab is left to Obsidian.
Limitations
- Indenting a list item moves only that line, not its child items. Select the children as well to move them together.
Installation
Install Indent with Spaces from Settings → Community plugins → Browse.
Manual
- Download
main.jsandmanifest.jsonfrom the latest release. - Put them in
<vault>/.obsidian/plugins/two-space-indent/(the plugin id staystwo-space-indent). - Reload Obsidian and enable Indent with Spaces in Settings → Community plugins.
License
Releasing
- Bump
versioninmanifest.jsonand add it toversions.json. - Commit, then push a tag with the exact version, for example
git tag 0.4.1 && git push origin main 0.4.1.
The release workflow builds the GitHub release and attaches artifact attestations for main.js and manifest.json.
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.