Option to create a new note in the current directory

I really like @goodsignal idea to have some extended syntax for internal links.

What about this:

  • we have three options in the Preferences: “Root”, “Same folder”, or “Specified folder ____".
  • we can use default syntax [[internal link]] for the option currently set in Preferences.
  • each of these three options has it’s own syntax: say, [[/internal link]] for Root, [[.internal link]] for Same folder and [[~internal link]] for Specified folder.
  • and, of course, we can specify the exact note location by specifying path: [[./subfolder/internal link]]

Usage examples:

If the Preferences are set to Root, use [[internal link]] to save note in root, [[.internal link]] to save note in the same folder and [[~internal link]] to save note in the specified folder.

If the Preferences are set to Same folder, use [[/internal link]] to save note in root, [[internal link]] to save note in the same folder and [[~internal link]] to save note in the specified folder.

If the Preferences are set to Specified folder, use [[/internal link]] to save note in root, [[.internal link]] to save note in the same folder and [[internal link]] to save note in the specified folder.

What do you think? If this sounds too complicated, I’m pretty happy with just a hotkey to quick toggle between the three available options in the preferences. :slight_smile:

1 Like

Just to be clear, I’m proposing that Obsidian handles the autotext and saving location. But not creating a new markdown syntax. Entering [-[ in Obsidian would result in the normal [[]] auto-text showing in the Edit body. But Obsidian would create the new note in the current directory for this link. The same process would work for creating links from highlighted text.

  1. Highlight New Note
  2. Type [-[ macro
  3. Get a New Note saved in current directory
  4. See [[New Note]] in Edit body

If options for “Root”, “Same folder”, or “Specified folder ____” are implemented, the macro behavior should do the opposit of the default setting to maximize utility. i.e.

  • Root or Specified folder is set as Default, then [-[ saves in current folder.
  • Current folder is set as Default, then [-[ saves in Root folder

I’m sure the devs are capable of anything :wink: but I’m suggesting the idea that the alternate indicator is between the two left brackets. It just seems easier to parse than any variations in the Note Title area. If Valery’s notation were used, I’d just shift the variation out of the Title and into the bracket macro

  • [[ -> root folder
  • [/[ -> same folder
  • [~[ -> special folder
    (I only picked [-[ because the dash is the closest key for speed)

Or maybe user selected key combinations will be added as a settings feature in addition to keyboard shortcuts :slight_smile: And these would be in the list of customizable macros. I’m sure this feature would also help Obsidian users who are avid MediaWiki contributors. They could set === to auto-generate ### and not worry about retraining their muscle memory.

Another option that’s likely simple to implement and may satisfy Valery, would be to just make the Link Suggestion box a little smarter. Maybe this is what Valery was suggesting and I didn’t understand. But

  • [[./ would automatically put Path/To/Current/Working/Directory/ at the top of the list
  • [[~ would automatically put Special/Directory/Location at the top of the list
  • [[p/t/s/d would automatically put Path/To/Specific/Directory at the top of the list as the closest intelligent match to an existing directory tree :laughing:

And Obsidian would simplify the [[Note Title]] after the link is created as it currently does, unless there’s a duplicate and a parent directory is required for singularity.

It seems problems would arise when creating links from highlighted text that the macros above would handle gracefully. But maybe this easily attainable half-solution would be enough.

2 Likes

I like that as it’s an easy way to extend the location via command keys. For final presentation of the link those special characters are then omitted.

1 Like

The program can pop up a window to disambiguate if the text matches more than one file.

Good to see this feature in v0.6.3. Thanks!

1 Like

If it’s working as expected I’ll archive this. Thanks!

It is. At least as I expected! Thanks!

1 Like

Got it! Although I’m a bit nervous about moving a long thread like this into archive, it’s not locked so anyone can still @ me or open something new and link to here if they feel like this shouldn’t be archived.

Great discussion guys!

Agreed.

Though, IMHO github issues or some such interface is much better for keeping track of bugs & features & blue sky ideas. You can have long drawn out discussion there as well + you can keep track of the state.

Any update on this feature request?

1 Like

there is an option now to create a note in the same directory of the file you are currently editing.

2 Likes

just noticed it. thanks a lot :slight_smile:

Personally, I don’t think it is a good idea to use folders to express (and enforce) a hierarchical organization (especially a deep hierarchy).

A bit late to the game here, but why don’t you recommend this? This is my preferred way to structure my notes so i’m interested if there are technical reasons/limitations not to do this (ie. search will become slow as more files are created, etc)

@DenHolland
one of the reasons: Some software is not able to manage excessively long paths, which can lead e.g. to data loss, inability to open or rename files/folders, … (Experienced by myself)
Discussed in:

2 Likes

Thanks for in info! I’ll read through these resources. Had no idea that max path length was a thing. Not only for the OS, but software like OneDrive has a limit of 400 (well under mac os limit of 1024). Could easily see how not knowing this could lead to a very hard to track down issue

First, the implementation of Options → Files & Links → Default location for new notes let me feel some worry. I thought when I click the left navigation folder item, then click the new note button, the file will create under the folder I selected, but it is not true. The folder in navigation seems don’t accept selected status, thus made my expectation of select and create not match. I mean, this is a relative natural action after using so many year windows + gnome, could we consider that?

And also, how about the folder create, that option should also control the action of create new folder within same current folder I believe.