Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raindrop.io Suggestions #34

Open
CharlesARoy opened this issue Jun 6, 2023 · 5 comments
Open

Raindrop.io Suggestions #34

CharlesARoy opened this issue Jun 6, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@CharlesARoy
Copy link

CharlesARoy commented Jun 6, 2023

Hi @dhruvmanila ,

Thanks for all your work in making the Raindrop bookmarks available, it works amazingly and I really appreciate it!

After using it for a bit, two ideas occurred to me that might make it even better.

  1. This might not be available via the Raindrop.io API, but it would be awesome if we could search for bookmarks using information beyond the title and URL. Above all, I'd be interested in searching among my tags. If it were possible to launch the Telescope fuzzy finder to search among Titles/URLs and/or tags, that would be even better.
  2. Loading all my bookmarks in a background process is super effective as long as I stay in the same instance of Neovim. I'm not sure how you load and store the bookmarks exactly, but it would be awesome if that loaded information was available to any instance of Neovim that is running. Is there a way to store the bookmarks in a local data structure that be loaded and updated by any instance of Neovim?

Edit: To help with 2, I did the logical thing and created an autocommand to start loading my bookmarks as soon as Nvim loads -- might be good to mention in the setup docs.

vim.api.nvim_create_autocmd({ "VimEnter" }, {
    callback = function()
        vim.cmd "lua require('telescope').extensions.bookmarks.bookmarks(opts)"
    end,
})
@dhruvmanila
Copy link
Owner

Thanks for all your work in making the Raindrop bookmarks available, it works amazingly and I really appreciate it!

Thanks a lot! Good to know you find this useful :)

For (1), we do support tags but currently it's only available for buku. I believe the API would already be sending this information so it should be trivial to add.

For (2), there are a few ideas but to give some context the bookmarks are stored in memory while the Neovim instance is running:

-- Store the raindrop bookmarks for the current Neovim session.
---@type Bookmark[]
local bookmarks = {}

  1. We could store it on disk and load it when invoked for the first time but then when do we refresh the cache or how to invalidate it? We could just start a background job on VimEnter.
  2. A new option to let user opt-in to start the background job on VimEnter. Maybe we could make it the default option and let user opt-out of it if they want to. This option can be provided in (1) as well.

@dhruvmanila dhruvmanila added the enhancement New feature or request label Jun 7, 2023
@CharlesARoy
Copy link
Author

That all sounds great to me!

  1. Personally, I only add like, 3-10 bookmarks per week, so my bookmarks don't change very much day to day. If they could be cached on disk that would be great. How/when to update them is definitely the most tricky part. Launching a background process to get the latest bookmarks on VimEnter sounds good. I don't know if there could be any issues if Vim is exited while the cache is being updated though.
  2. That sounds perfect.

@thenbe
Copy link

thenbe commented Sep 29, 2023

I created an fzf-raindrop picker that might be of interest. It only makes a single network request to the Raindrop API - to get a single CSV containing every item. This avoids any rate-limits. And by having local access to all the bookmarks, we can do some simple data massaging to enable searching through tags using the # character (eg. #mytag).

The picker does not "live" in neovim; personally I bind a global system keymap that launches a floating terminal window running the picker (as seen in the demo video).

@dhruvmanila
Copy link
Owner

Thanks for chiming in! I'll probably take a look at this sometime in this month.

@CharlesARoy
Copy link
Author

Very cool @thenbe!
Storing the bookmarks locally with the option to update them as needed is an excellent approach. The option to search through tags is also very useful.
That said, using Telescope as my picker trumps everything else, at least for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants