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

feature: description for bookmarks

Open corani opened this issue 2 years ago • 2 comments

Rather than a simple list of URLs, it would be nice to be able to add a description for each URL.

corani avatar Jul 12 '22 06:07 corani

@corani, not sure how useful it will be. If you have an idea of how to implement this, go ahead and raise the PR.

lalitmee avatar Jul 13 '22 04:07 lalitmee

It would be useful with long opaque URLs, where it's not clear from the URL itself what it is pointing to. As to implementation, I suppose you could do something like:

bookmarks = {
    ["https://some.nested/website"] = "Description",
    "https://github.com/lalitmee/browse.nvim",
}

or even using a nested table:

bookmarks = {
    { ["url"] = "https://some.nested/website", ["description"] = "Some description" },
    { ["url"] = "https://github.com/lalitmee/browse.nvim" },
}

corani avatar Aug 25 '22 03:08 corani

Implemented in 3336967066f57af56e6d2a8c07ac09acce351cd5

local bookmarks = {
  ["github"] = {
      ["name"] = "search github from neovim", -- description of the group
      ["code_search"] = "https://github.com/search?q=%s&type=code",
      ["repo_search"] = "https://github.com/search?q=%s&type=repositories",
      ["issues_search"] = "https://github.com/search?q=%s&type=issues",
      ["pulls_search"] = "https://github.com/search?q=%s&type=pullrequests",
  },
}

lalitmee avatar Feb 02 '23 18:02 lalitmee