1
0
Fork
You've already forked bufmarks.nvim
0
Navigate within your project files using ergonomic marks.
  • Lua 100%
2026年05月31日 13:25:33 +02:00
lua/bufmarks 🔧 Internalize mark/navigate verbs for mappings. 2026年05月23日 21:46:42 +02:00
plugin Accepting/validate first option: bufmark folder. 2026年05月23日 21:35:03 +02:00
LICENSE 🌐 License under GPL-3. 2026年05月23日 21:35:03 +02:00
README.md 📖 Illustrate with asciinema. 2026年05月31日 13:25:33 +02:00
stylua.toml 🐛 Several marks may point to the same file. 2026年05月23日 21:35:03 +02:00

This nvim navigation plugin gets its inspiration from Harpoon, but it indexes buffers with "mark"-like keys instead of a plain ordered list.

asciicast

-- Install.
vim.pack.add({
	"https://codeberg.org/iago-lito/bufmarks.nvim",
})
-- Configure.
local bm = require("bufmarks")
bm.setup({
	-- Where to store marks files (defaults to the following).
	data = vim.fs.joinpath(vim.fn.stdpath("data"), "bufmarks"),
})
-- Every "project" has its own independent set of marks.
-- You get to decide what a bufmark "project" is or means.
-- In this example, a bufmark "project" is the folder where vim was started.
vim.api.nvim_create_autocmd("VimEnter", {
	group = vim.api.nvim_create_augroup("BufMarkProject", { clear = true }),
	callback = function()
		bm.set_project(vim.fn.getcwd())
	end,
})
-- No default mapping: choose your own.
vim.keymap.set("n", "<+", bm.mark) -- Hit <+a to mark current file.
vim.keymap.set("n", "<", bm.navigate) -- Hit <a to navigate to file marked with 'a'.
vim.keymap.set("n", "<>", bm.display) -- Hit <> to see/edit current marks.
-- Quit the display window with 'q`, or use `<cr>` to navigate to the mark under cursor.