Click links/files to open in new tab by default

This plugin patleeman/obsidian-open-in-new-tab (github.com) has solved this problem, Thanks to the author.

1 Like

@patleeman thanks for the plugin, it really solves the problem.

To make it perfect, could it also allow the old behaviour via a custom shortcut?

Basically, let the plugin invert default behaviour, without losing the variety of tools available to user.
No plugin: click = same tab, Ctrl+click = new tab.
With plugin: click = new tab, Ctrl+click = same tab.

Why?
Because sometimes (like 25% of the time) I’d actually want to reuse active tab :slight_smile:

2 Likes

Hello friends - I wanted to play with the plugin a bit and give it time to sink in before commenting.

@patleeman - many thanks for the plugin and your help.

Two things occur to me.

  1. The plugin works great –
  2. but there are apparently many corner cases and it’s not clear the author wants to keep maintaining it, given the various hacks and tricks needed. See here for his comment to that effect
  3. I was also really hoping for the browser-style option to cmd-click to open in new tabs, in the background, which is really what I’d like. i.e. by default opens new tab and on cmd-click opens links in a background tab.

At this point it all seems to get kludgy. The ideal behavior would be to allow a couple options in the settings for this.

I understand why there’s some resistance to adding that, but I’d like to point out that the whole benefit of Obsidian - vs just editing text/markdown files - is that it makes little productivity quirks like this easier.

I’ll shut up with feature requests now, but I do think this would be a nearly-trivial thing to implement in the native app, plugins have serious drawbacks (some of them articulated above) esp for something like this, and not sure anyone actually wants to build one, and clearly lots of people would find this very useful – and exactly the kind of benefit to a “markdown IDE” like Obsidian.

4 Likes

Thanks so much for the plugin, I hope it gets into the community plugins merged soon!

Is it there another way to use it on mobile in the meantime?

This is fabulous! I was certain there would be a setting to toggle this. I get that you might want the current behavior by default, but enabling opening files in new tabs should be a setting. Now clicking files behaves as I wanted. Both for opening files in new tabs and switching to the correct tab for open files. With a Magic Mouse middle-clicking isn’t an option and key modifiers are a nuisance for what should be normal behavior (modifiers should modify normal behavior not required to do it).
THANK YOU!

Hi there, I made a plugin that supports all corner cases, even if you open a file from another plugin (ie QuickSwitcher++, etc). It modifies the Obsidian openFile() function, which everything else uses, so I don’t have to manually configure opening from a note, from search, from backlinks, etc. I will be maintaining it aggressively as I use Obsidian for everything and I’m always on the latest version.

It currently also opens pdfs in default system viewer. I’ll be adding a toggle for that tomorrow so those who don’t want that additional behavior can turn it off.

7 Likes

Very, very perfect. Thanks a lot to the author of the plugin, I also changed a line of code to open png, jpg files using the system default program.

1 Like

this is really brilliant! thank you! What a huge feature missing just solved! :slight_smile: many thanks!

1 Like

@tronicdude – thank you very much! agreed with others, this works great on desktop (including opening in native viewer, works great with PDFs in Preview).

I’ll comment in the Github repo but notice a few issues on mobile (which I recognize you have not yet fully tested according to the notes) - at least on iOS:

  • open link to a note - appears to open it within the same stack of tabs. (i.e., if I select … > Open in new tab, it opens in a new tab which I can then close. If I just select and follow the link it keeps it in the same tab and the back ← arrow is active). I would expect to behave the same as explicit ‘open in new tab’
  • open link to a PDF - still requires you to be in edit mode. then you still see “follow link” hover and “open link” and “open in new tab”. But these keep you in Obsidian - they do not open with the native PDF browser (or whatever the iOS equivalent would be, presumably share sheet). I would expect the share sheet.

Thanks again!!

I just discovered Obsidian this week, and the first thing I noticed was that I wanted the behavior described in this thread. It simply suits my workflow better, where I often have lots of leaf notes linked from a central doc, and want to jump from leaf to leaf quickly.

That said, the aidan-gibson/obsidian-opener plugin posted above worked perfectly for me. Thanks for creating that!

4 Likes

I usually do:

  • cmd+o
  • find the file I want to open
  • press enter
  • realize that’s not what I wanted
  • hit the navigate back arrow
  • do cmd+o again
  • find the file
  • press cmd+enter

So having the option to select if you want to open in the same tab or in a new tab, by default, would be extremely helpful for me as well

3 Likes

Please do consider making the default behavior opening a new tab when the file is not already open, otherwise placing focus on the existing tab for files that are already open in a tab. Thanks!

3 Likes

+1 I need it

2 Likes

+1 this is really slowing me down not having this as an option, as I am constantly having to go back and find the file I just had open :person_facepalming:

5 Likes

+1 here. I shouldn’t need a hacky plugin for basic expected behavior. All those saying middle roller click are helpful, but clearly missing the point.

This is why people still use vim …

3 Likes

+1 here. It should not be too hard to implement this feature.

3 Likes

+1, this would save a lot of time for me

3 Likes

+1 Please allow this as an option. I keep forgetting to use the extra modifier key when opening files using “Open Quickly…” and keep overwrite existing tabs. I end up checking this thread on a weekly basis in frustration, hoping for an update

2 Likes

+1 for a toggle for changing the behaviour when the file is clicked. I ended up here because I keep overwriting already open tabs and I am getting tired of it. I never choose to open anything in the same tab or window, not ever, whenever I do not need a tab any more, I deliberately close it - I like to have full control of what is open and what closes. So the toggle to choose the way the mouse action on the file in the files list behaves would be much appreciated!

5 Likes

@iUmbra, @4lun, @MattLatt, @TreeDiagramIRC, @liamosee, @rcheesley, and @typewriterer - If you haven’t already done so, make sure you hit the like button (heart icon) on the original post, too, since that’s the actual +1 tally that the devs see!

1 Like