dhruvmanila / browser-bookmarks.nvim

A Neovim plugin to open your browser bookmarks right from the editor!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use bookmarks directories

danymat opened this issue · comments

Hello, thanks for the plugin, it works well !

I'm using it with safari, and I propose these features:

  1. Using bookmark directories as telescope directories

Capture d’écran 2022-01-11 à 10 43 12

  1. Add option to only open a certain directory, for example: Telescope bookmarks Pentest

Capture d’écran 2022-01-11 à 10 44 04

What do you think about these ? I really like the second one, as I could create a proper directory for neovim

Hey, I'm glad you find it useful.

  1. Using bookmark directories as telescope directories

I don't know how that would be useful as, for me, Telescope is something I use to fuzzy search a list of items and "navigating" a list has never appealed to me. But hey, that's me, if you think this could be useful I will be more than happy to help you implement it.

  1. Add option to only open a certain directory, for example: Telescope bookmarks Pentest

This is quite useful, and the way I do it is by directly typing the word "Pentest" in the prompt window and Telescope will filter out the results to show the relevant results on the top. Another way would be to use nvim-telescope/telescope-fzf-native.nvim with the exact match token '.

Again, if you think the proposed features are useful, you can submit a PR and I can help you with that.

I don't know how that would be useful as, for me, Telescope is something I use to fuzzy search a list of items and "navigating" a list has never appealed to me. But hey, that's me, if you think this could be useful I will be more than happy to help you implement it.

You're right about this, I'm dropping this idea.

This is quite useful, and the way I do it is by directly typing the word "Pentest" in the prompt window and Telescope will filter out the results to show the relevant results on the top. Another way would be to use nvim-telescope/telescope-fzf-native.nvim with the exact match token '

Sure ! However I think having a map for Telescope bookmarks Pentest (or any keyword) could be hyper beneficial for people like me who divide their bookmarks in sections

I've looked into how Telescope accepts command line arguments and sadly the way you've mentioned (Telescope bookmarks Pentest) is not possible as the plugin will translate that to:

require("telescope").extensions.bookmarks.Pentest()

What is possible though is to use keyword arguments like filter=Pentest which can be passed either of the following way:

From the command-line:

:Telescope bookmarks filter=Pentest

lua function call:

require("telescope").extensions.bookmarks.bookmarks({ filter = "Pentest" })

Does this work?

This can be an idea indeed, however we could get false positives (some bookmarks called pentest but not on penitent directory)

(some bookmarks called pentest but not on penitent directory)

I don't understand this. Can you elaborate a bit?

Also, do you want the filter to work on nested directories or just on the root directories? We could use a trie data structure to represent this which could make filtering easy or else just use simple pattern matching. I could even keep a separate entry which will include the directory path only.

Hi @danymat, any update here?

Hello, no update, didn't have time to get into that. I will try to implement something if I get time.

I don't understand this. Can you elaborate a bit?

Yes, as telescope is fuzzy search, a bookmark with pentest inside will be in the same search result as the bookmarks inside a Pentest/ directory.

Keep me in touch if you have any ideas :)

[...] Another way would be to use nvim-telescope/telescope-fzf-native.nvim with the exact match token '.

FYI: This works on ibhagwan/fzf-lua without the linked plugin.