obsidian-api icon indicating copy to clipboard operation
obsidian-api copied to clipboard

Expose API to get Config

Open deathau opened this issue 4 years ago • 5 comments

I'd like app.vault.getConfig() exposed, so I can get configuration settings to apply to custom file handlers (for example, my CookLang plugin). Even better if we can get some sort of event to listen for when specific config values change, so plugin views can respond to config changes like line numbers, word wrap, readable line length, etc.

deathau avatar Nov 16 '21 23:11 deathau

Some side-notes might be useful, after some try-and-error, I found a way to access the configuration files and folders by this:

app.vault.adapter.list(app.vault.configDir).then(x=>console.log(x))
// then use app.vault.adapter.list recursively

But I don't know whether it's possible to listen to file changes.

fyears avatar Jan 03 '22 13:01 fyears

I would like this as well so i could read attachmentFolderPath

sandorex avatar May 11 '22 13:05 sandorex

I would love to have this to make my custom dictionary sync plugin (WIP) more user-friendly.

chunjiw avatar Nov 16 '23 01:11 chunjiw

Some side-notes might be useful, after some try-and-error, I found a way to access the configuration files and folders by this:

app.vault.adapter.list(app.vault.configDir).then(x=>console.log(x))
// then use app.vault.adapter.list recursively

But I don't know whether it's possible to listen to file changes.

I think this is an access to the config of a specific vault. I don't know what the OP had in mind, but I would like to access the config of Obsidian as an app, because the custom dictionary is stored there. (for Linux and Windows. For Mac, it is outside of the app)

chunjiw avatar Nov 17 '23 02:11 chunjiw

What is going on with this issue please ?

AaronNGray avatar May 14 '24 19:05 AaronNGray