Indent driven auto heading creation mode

Sometimes you just want to flesh out an outline using headings with automatically added hashtags based on your indentation level. This would allow you to indent multiple tabs without it commenting out, for example creating an h2 heading then return and tab twice to automatically add the four hashtags and space for the h4 heading.

It would also be nice if you could take a numbered, bulleted, or checkbox list and apply this auto heading creation after the fact, with option to remove the brackets, dashes, and number formatting.

As a side note, it would be cool if these indented headings had an option to be previewed with indentation.

As an extra bonus, maybe selecting and copying a folded heading line in this mode would not only copy the folded headings, but also adjust them to match the proper relative heading level based on the cursor’s indentation when the paste occurs.

Thanks.

4 Likes

I was trying to come up with my own workaround for this and tried to come up with a Search and Replace tactic to be able to search a Tab Dash Space as opposed to a Tab Tab Dash Space in such a way that I would only return the Tab Dash Space for the ones where the line was indented once.

If anyone knows how to do this, it would be helpful in converting a note that was set up as an indented list into a note that is set up with headings.

Dash Space —> H1 Heading
Tab Dash Space —> H2 Heading
Tab Tab Dash Space —> H3 Heading
Tab Tab Tab Dash Space —> H4 Heading
Tab Tab Tab Tab Dash Space —> H5 Heading
Tab Tab Tab Tab Tab Dash Space —> H6 Heading

Thanks in advance.

1 Like

This can be done in VSCode using search and replace utilizing search and replace with a new line and the specific number of spaces for the indents rather than trying to use tabs like I was suggesting before.

Hi- can you explain to me how you did this? I have heaps of notes ive import from word docs which didnt have the headings format come across. I’m a coding noob/ ignoramus :confused:

1 Like

Before trying anything else, it may be worth checking out the suggestions on this thread: Easy way to markdown Microsoft Word docs into Obsidian?. There may be additional helpful threads, but I saw some decent looking solutions there, although I haven’t personally tried them.

If you don’t have any luck, it would help if you shared what your Word documents look like and what you would like them to be interpreted as in Obsidian.

Good luck!

HI- yes I ended up using pandoc and creating a batch process to convert the files (with help from forums and chat GPT). The word docs were formatted with headings and TOC which didn’t get converted annoyingly.

1 Like