epwalsh / obsidian.nvim

Obsidian 🤝 Neovim
Apache License 2.0
3.82k stars 170 forks source link

Nested commands #662

Open ridulfo opened 1 month ago

ridulfo commented 1 month ago

🚀 The feature, motivation and pitch

Hi! First off, thanks for this plugin! I use it literally every day.

In telescope.nvim the commands are nested under :Telescope. This allows for an easier time finding and writing a command. In obsidian.nvim, when I type :O and then hit tab it suggests:

It would make it easier to use the command line if you could work in the following way:

  1. :O and hit tab, autocompleting it to :Obsidian.
  2. :Obsidian ba and hit tab, autocompleting to :Obsidian backlinks

As mentioned, this is the way telescope.nvim works by providing a complete function to nvim_create_user_command. Like so code.

This does not have to be a breaking change. We could introduce a new command just called :Obsidian with the above mentioned properties.

Additional context

Obsidian.nvim today:

image

Telescope.nvim:

image

Would be happy to create a PR for this if it sounds interesting. 🚀

PS sorry for light-mode theme, it is sunny outside 😅

epwalsh commented 1 month ago

Hey @ridulfo I like that idea a lot! Happy to accept a PR

epwalsh commented 1 month ago

@ridulfo I was bored today so I took a stab at this: #668.