Use H1 or YAML property "title" instead of or in addition to filename as display name

@austin Related request that would help to see context when the note is scrolled down:


@saf-dmitry great workaround in search. Thanks. Here is a modification:
“#” alone matches fragment identifiers in URLs so I match only # at line beginning.
Here is regex that matches and highlights whole title line:
/^(#|title:) [^\n]*/ to be followed by search string.

The regex can be put in by text expander.

Below is AutoHotkey script that automatically writes the hotstring into search field after pressing Ctrl+Shift+F:

; AutoHotkey code to prefix title matching regexbefore search string
#IfWinActive ahk_exe Obsidian.exe
~^+f:: ; Ctrl+Shift+F ; Find in Obsidian
  Sleep, 100 ; maybe not needed 
  SendLevel, 0
  Send, {LControl up}{RControl up}{LShift up}{RShift up}
  Send, {Raw}/^(#|title:) [^\n]*/
  Send, {space}
  return
#IfWinActive

CSS snippet that can be tweaked to make highlighted titles easier to read:

.theme-light {
  --text-highlight-bg: rgba(0, 128, 0, 1);
}

.theme-dark {
  --text-highlight-bg: rgba(0, 128, 0, 1);
}
1 Like