Keyboard Shortcuts for H1-H

Use case or problem

Working with the keyboard only, i can barely format the Headings. Even though I use the Hashtag (MacOS Version), the Headings Formatting are not always recognized.

Proposed solution

Keyboard Shortcuts eg: Option KEy +1 = H1, Option KEy +2 = H2 etcโ€ฆ

Thanks for your feedback.

I believe you could use the built-in hotkeys settings with the โ€œSet as headingโ€ commands.

2 Likes

Possible culprits:

  • The hashes need to start at the beginning of the line, with no indentation.
  • There needs to be a space between the hash(es) and the text.
# Heading
  # Not a heading
#Not a heading either
2 Likes

I tested this source in reading mode and it should produce headings despite optional 0โ€“3 initial space before #:

ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท
 # heading 1
  ## heading 2
   ### heading 3
   ###       heading 3
   ###           heading 3         ###

What do you think incorporating that syntax to live preview? Typing 1โ€“3 initial spaces into lines have some kind of special function in Obsidian. When you write first line with 1โ€“3 space indentation, that indentation is preserved in the next line automatically:

ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท
  my content in line 1
  my content in the next line <!-- two initial spaces are added automatically! -->

Obsidian has at least three separate indentationโ€‘related settings but I think none of these control the behavior I described above. In any case it stops headings being recognized in live preview which is inconsistent to reading view.

I think itโ€™d be a nice UX if the keyboard shortcuts Ctrl+Alt+1 through 6 were default-assigned to Set as Header 1 through 6. This mirrors gdocs, which a few people might have used.