Have Obsidian be the handler of .md files / Add ability to use Obsidian as a markdown editor on files outside vault (file association)

A suggestion to have the possibility to make Obsidian the default app to open .md files, when accessing them in Finder.

That would allow for very quick note-opening opportunities using Alfred. Simply open Alfred, type in the name of the note hit enter and have the note opened straight in Obsidian.

My environment is MacOS but I guess there are familiar easy-access workflow possible in different environments as well :slight_smile:

83 Likes

It’s been a little while since I last used the Mac but in the Finder you do Get Info in a file and change the default app to open such files. Hope that helps.

1 Like

Hey, thanks for the reply! Yeah, that would be an option. I went into finder and picked Obsidian as the default. Nothing happened though and Obsidian also is not included in the list of “Recommended” to open .md files.

I think there would need to be a sort of implementation from the developing side to make opening the files from the finder in Obsidian possible.

2 Likes

Obsidian works with a vault associated with the file so there’s some extra work where the file system has to be parsed to find the hidden vault folder in order for the file to open. And MacOSX (or Windows AFAIK) does not have such support in its Open default settings.

Drag and drop might work if something like this is implemented. Or on the Mac, as Share extension, or Services system extension with keybindings could work.

1 Like

Default md viewer with the option to import into a vault :+1:

14 Likes

I"m looking for an option to import md files directly into Obsidian app. Is this the same as you’re requesting? Currently I just drag the files into the Obsidian directory and open from within.

Yeah, that would be a great expansion of what I am suggesting! A solution like the one @goodsignal proposed sounds great.

It would be nice to have the ability to right click a folder in explorer/finder and have a shortcut to open the folder with obsidian in the context menu.

2 Likes

I would find this functionality very useful too. My imagined use cases include:

  • As you mentioned, using Alfred to launch Obsidian directly to a document
  • I index my Obsidian Vault with DEVONthink. If I can set Obsidian as the default markdown editor, when I’m viewing Obsidian notes in DT, I can open it in Obsidian with a simple keyboard shortcut.

Great idea

1 Like

I’m not able to set Obsi as default app for opening markdown files (Mac OS). Can it be fixed or implemented…

It would be very helpful in my workflow involving indexed folders in Devonthink…
Cheers, a.

2 Likes

I’ve try it but yes, it can not open a file from file explorer directly yet. Maybe you should try to create a vault which include obsidian file and Devonthink file as a temporary solution?

I noticed I cannot open .md files using Obsidian. My workflow consists of Alfred > filename.md . I havent seen this on the roadmap either.

I was looking for this too.

I would love this feature too.

  • Ability to set Obsidian as default app for opening .md files
  • If the .md file is already in one of Obsidian’s vaults, then Obsidian opens that file in that vault.
    • but if the file is not in one of Obsidian’s vaults then:
      1. obsidian simply opens the file as an editor (without graph, backlinks support etc.) and
      2. obsidian offers to import the file into the vault of your choice
5 Likes

Mostly reformulating the post above↑
Expected behavior when Obsidian is set as default app for “.md” files:

When Obsidian receives request to open “a/path/to/<filename.md>”,
Climb up the folder hierarchy and check for existence of sibling folder named “.obsidian”.
When found, open corresponding vault. This will find innermost vault when nested vaults are being used.

current_folder := "a/path/to" // path to file
Loop{
- If current_folder has direct subfolder ".obsidian": 
	- open obsidian://vault/<current_folder>/<filename.md>
	- return
- Else If current_folder has parent folder: 
	- current_folder := parent folder of current_folder
- Else: 
	- Display dialogue with options:
		- open just in markdown editor without vault (default)
		- select which folder from the path to transform into vault
		- move the file into existing vault
			- Display dialogue with options:
				- select one of existing vaults, recently open vault being default
				- cancel
					- return
		- cancel
			- return
}
5 Likes

This behavior would be perfect for Zotero integration with mdnotes – I could open the created .md file within Zotero and jump directly to the notes file in Obsidian. This would also enable the articles themselves to easily serve as “start” parts, which fits in nicely with Zettelkasten principles.

For now, I have to search twice – once in Zotero when finding the article, and another within Obsidian to search for the created .md file

I would also like to see this happen. Using Alfred and or Finder, even with the setting up to Obisian as the default app, no files will open.

1 Like

You might appreciate:

2 Likes

Thanks @ryanjamurphy I will have a look at that. Downloaded it on iOS and will check it out later. Hopefully I can understand it. :blush: