Automate the switching on and off of properties

What I’m trying to do

Hello!

I can’t find information how to put hotkeys on “properties in document” to enable (visible) and disable (hidden)?

As I understand, you can do it through a macro, but I need to write this action through some code?

Things I have tried

obsidian forum, reddit, youtube, gpt

You currently can fold/unfold inline display of document properties with a hotkey. There is, however, no possibility to toggle display/hide of the properties.

Another way to go about this is to hide the properties on top of the document, and instead use the Core properties plugin to display properties. That pane can be shown/focused using a hotkey. An advantage can be that properties remain visible also while scrolling through the note.

3 Likes

Thx! :slight_smile: If I can’t find more options, I’ll take it into consideration. but it would be interesting to know about ways to on/off propeties.

It shouldn’t be that hard to use a CSS snippet to hide the properties, and I believe there is at least one plugin allowing you to toggle various CSS snippets on/off. So it should be doable to do this even if there is no specific command to do so in the default setup.

1 Like

Found ways to remove properties via CSS only in read mode. Are there any ways to remove properties in edit mode as well? I’m going to just set the hotkey to on/off later on

It seems like the following is able to completely hide the property section (or frontmatter lines) from live preview and source mode:

.metadata-container,
.cm-line:has(.cm-hmd-frontmatter) {
  display: none !important; 
}

The first selector, .metadata-container, refers to live preview, and the other to source mode. This kind of messes with the line numbering if you got that enabled, just so that you’re forewarned on that issue.

ty <333