# Ability to customize code block indentation

**URL:** <https://community.supernotes.app/t/ability-to-customize-code-block-indentation/1856>\
**Category:** Feature Requests\
**Tags:** Implemented\
**Created:** [August 12, 2023, 8:09pm UTC](https://community.supernotes.app/t/ability-to-customize-code-block-indentation/1856 "2023-08-12T20:09:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fuzzy.beach](https://community.supernotes.app/letter_avatar_proxy/v4/letter/f/47e85d/32.png) [@fuzzy.beach](https://community.supernotes.app/u/fuzzy.beach)\
**Post date:** [August 12, 2023, 8:09pm UTC](https://community.supernotes.app/t/ability-to-customize-code-block-indentation/1856/1 "2023-08-12T20:09:53Z")

</div>

It would be awesome to enable custom indentation for code blocks. It looks like currently this defaults to 4 spaces, whereas I find 2 spaces much more readable, given the narrow nature of the cards.

I have noticed that the spacing also get styled even more “wide” in the view mode, is this on purpose?  
For example here is an edit-mode indent  
 ![image](https://community.supernotes.app/uploads/default/original/2X/3/3bb5213c77c10cb4d86ba927ff1e06358ab7e9af.png)  
Which turns to this  
 ![image](https://community.supernotes.app/uploads/default/original/2X/2/239914a4f4dc39d0d9f0638f7cc8532377f9b460.png)

I purposefully excluded the padding of the code block element in the view-mode to compare the indentation itself. As you can see it nearly doubles 🤔 Is this a bug?

---

<div class="post-metadata">

**Author:** ![tobias](https://community.supernotes.app/user_avatar/community.supernotes.app/tobias/32/1181_2.png) [@tobias](https://community.supernotes.app/u/tobias)\
**Post date:** [August 13, 2023, 2:24am UTC](https://community.supernotes.app/t/ability-to-customize-code-block-indentation/1856/2 "2023-08-13T02:24:23Z")

</div>

Hi @fuzzy.beach,

Custom code block indentation has already been implemented. Have you tried changing your ident type in App Preferences \> Custom Behavior \> Indent Type? You can change this from 4 spaces to 2 spaces.

 ![CleanShot 2023-08-13 at 10.25.06@2x](https://community.supernotes.app/uploads/default/original/2X/6/6218867683a135c244b912a295c472b5ee844cc6.jpeg)

Which app / os are you using? Could you share the raw markdown below? I’m unable to replicate your screenshots for me they aren’t styled even more wide.

---

<div class="post-metadata">

**Author:** ![fuzzy.beach](https://community.supernotes.app/letter_avatar_proxy/v4/letter/f/47e85d/32.png) [@fuzzy.beach](https://community.supernotes.app/u/fuzzy.beach)\
**Post date:** [August 13, 2023, 6:11pm UTC](https://community.supernotes.app/t/ability-to-customize-code-block-indentation/1856/3 "2023-08-13T18:11:43Z")

</div>

I am on M1 Mac with Ventura. Ah, that’s great, The two spaces setting works correctly. I previously had it set to `Tabs` (I guess that’s the default?). I think the behaviour may be due to that setting?

Sure, this is the markdown

````auto
```go
func main() {
  fmt.Println("One indent")
    fmt.Println("Two indents")

	for i := 0; i < 10; i++ {
		defer fmt.Println("Previous indent setting of `tab`")
	}

	fmt.Println("done")
}

...

````

The really odd thing is, that the for loop was indented with the setting set to “Tabs”, before I made the change. As you can see, A double indent of 2 spaces renders narrower than the previous setting, even though in markdown they look the same.

![image](https://community.supernotes.app/uploads/default/original/2X/4/48eb4635ab626d4c0fd81bb40904a8ce2fc00e5f.png)

![image](https://community.supernotes.app/uploads/default/original/2X/4/471f926aa079deb2b1fa0af1559f3b4fe20bb5dc.png)

---

<div class="post-metadata">

**Author:** ![tobias](https://community.supernotes.app/user_avatar/community.supernotes.app/tobias/32/1181_2.png) [@tobias](https://community.supernotes.app/u/tobias)\
**Post date:** [August 14, 2023, 2:28am UTC](https://community.supernotes.app/t/ability-to-customize-code-block-indentation/1856/4 "2023-08-14T02:28:30Z")

</div>

Hi @fuzzy.beach,

That makes sense thanks for the further info. We will look into why the rendering is a bit off with tabs.
