Home

Awesome

[!WARNING] Breaking change!

Dev branch will be merged into main branch next Saturday!

The json file db format will be changed.

To avoid data lose!! Be sure you have backed your current bookmark db file up

Pin the version to v0.5.4 to avoid this error message

Bookmarks.nvim

You only need one shortcut to add bookmarks.

show

Install and Config

-- with lazy.nvim
return {
  "LintaoAmons/bookmarks.nvim",
  tag = "v0.5.4", -- optional, pin the plugin at specific version for stability
  dependencies = {
    {"nvim-telescope/telescope.nvim"},
    {"stevearc/dressing.nvim"} -- optional: to have the same UI shown in the GIF
  }
}
<details> <summary>Detailed config</summary>

Right now we have only one config options

return { "LintaoAmons/bookmarks.nvim",
  config = function ()
    require("bookmarks").setup( {
      json_db_path = vim.fs.normalize(vim.fn.stdpath("config") .. "/bookmarks.db.json"),
      signs = {
        mark = { icon = "", color = "grey" },
      },
    })
  end
}
</details>

Commands and Keybindings

There's two concepts in this plugin: BookmarkList and Bookmark. You can look into the code to find the structure of those two domain objects

CommandDescription
BookmarksMarkMark current line into active BookmarkList.
BookmarksGotoGo to bookmark at current active BookmarkList
BookmarksCommandsFind and trigger a bookmark command.
BookmarksGotoRecentGo to latest visited/created Bookmark
<details> <summary>Commands we have right now</summary>
CommandDescription
[List] newcreate a new BookmarkList and set it to active and mark current line into this BookmarkList
[List] renamerename a BookmarkList
[List] deletedelete a bookmark list
[List] set activeset a BookmarkList as active
[List] Browsing all lists
[Mark] mark to listbookmark current line and add it to specific bookmark list
[Mark] rename bookmarkrename selected bookmark
[Mark] Browsing all marks
[Mark] delete bookmarkdelete selected bookmarks
</details>

This plugin don't provide any default keybinding. I recommend you to have those three keybindings.

vim.keymap.set({ "n", "v" }, "mm", "<cmd>BookmarksMark<cr>", { desc = "Mark current line into active BookmarkList." })
vim.keymap.set({ "n", "v" }, "mo", "<cmd>BookmarksGoto<cr>", { desc = "Go to bookmark at current active BookmarkList" })
vim.keymap.set({ "n", "v" }, "ma", "<cmd>BookmarksCommands<cr>", { desc = "Find and trigger a bookmark command." })
vim.keymap.set({ "n", "v" }, "mg", "<cmd>BookmarksGotoRecent<cr>", { desc = "Go to latest visited/created Bookmark" })

Thanks

CONTRIBUTING

Don't hesitate to ask me anything about the codebase if you want to contribute.

You can contact with me by drop me an email or telegram

FIND MORE USER FRIENDLY PLUGINS MADE BY ME

TODO

V1

V2