obsidian.nvim icon indicating copy to clipboard operation
obsidian.nvim copied to clipboard

Navigate back and forward

Open kappq opened this issue 1 year ago • 12 comments

🚀 The feature, motivation and pitch

One feature that I'm missing from Obsidian is the ability to navigate back and forward. Ideally it would be in the form of two new commands: :ObsidianBack and :ObsidianForward.

Alternatives

I realize that this can somewhat be achieved using CTRL-O and CTRL-I, however it's not quite the same for two reasons:

  • the jumplist includes cursor positions even within the same file (sometimes you need to press CTRL-O multiple times to actually jump back to your previous note);
  • the jumplist is universal (it's shared across all buffers), while in Obsidian each note has a different "jumplist".

Additional context

No response

kappq avatar Feb 18 '24 16:02 kappq

I would be willing to build this myself, however I'm not very familiar with Lua nor with how Neovim plugins are built so it will probably take a while.

kappq avatar Feb 18 '24 16:02 kappq

I second this feature request!

armaninux avatar Mar 02 '24 18:03 armaninux

I assume :ObsidianForward and :ObsidianBackward should just cycle through the already opened notes?!

If so, you can just use :bnext and :bprevious to jump to the next/prev buffer. These commands are often mapped to ]b and [b or similar.

Alternatively, you can use :Telescope buffers to jump to the open buffers.

I think this should solve your issue.

sotte avatar Mar 04 '24 13:03 sotte

I assume :ObsidianForward and :ObsidianBackward should just cycle through the already opened notes?!

If so, you can just use :bnext and :bprevious to jump to the next/prev buffer. These commands are often mapped to ]b and [b or similar.

Alternatively, you can use :Telescope buffers to jump to the open buffers.

I think this should solve your issue.

It shouldn't cycle through the already open notes, it should follow (either backwards or forward) the chain of notes that the user created by following various links, which is different from notes opened in different buffers. In fact, when you click on a link in Obsidian, it doesn't actually open it in a new tab, but in place of the current note. This also means that you can get to the same note in various ways.

kappq avatar Mar 04 '24 14:03 kappq

it's a slightly different thing; bnext and bprev are fixed and depend on the order of access; we're looking instead to navigating the buffers by access history, i.e. if I open 10 buffers: buf1 buf2 buf3 buf4 ... buf9 buf10 then access buf4 via a link in buf10, bprev will open buf3, but I want to go back to buf10

On Monday, March 4th, 2024 at 2:58 PM, Stefan Otte @.***> wrote:

I assume :ObsidianForward and :ObsidianBackward should just cycle through the already opened notes?!

If so, you can just use :bnext and :bprevious to jump to the next/prev buffer. These commands are often mapped to ]b and [b or similar.

Alternatively, you can use :Telescope buffers to jump to the open buffers.

I think this should solve your issue.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

armaninux avatar Mar 04 '24 14:03 armaninux

Ah, I see. Slightly different indeed. Thanks for clarifying.

sotte avatar Mar 04 '24 14:03 sotte

I think this plug-in does what u want: https://github.com/volskaya/windovigation.nvim

sotte avatar Mar 27 '24 12:03 sotte

I had the same issue and started to use ctrl-O and ctrl-I more. Not quite the same, but usually does the job. And no need for a plugin.

mscott99 avatar Aug 18 '24 18:08 mscott99

This is need more development, I am sure many people would love it.

777uliahshafar avatar Sep 01 '24 22:09 777uliahshafar