Raindrop.io Suggestions
CharlesARoy opened this issue · comments
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.
- 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.
- 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,
})
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:
- 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
. - 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.
That all sounds great to me!
- 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. - That sounds perfect.
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).
Thanks for chiming in! I'll probably take a look at this sometime in this month.