From ca5d985868ec95e919c7b7f6201a5dc7a42d8a9e Mon Sep 17 00:00:00 2001 From: Tilo K Date: Sun, 5 Oct 2025 21:42:01 +0200 Subject: [PATCH] add bookmarks --- lua/custom/plugins/bookmark.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 lua/custom/plugins/bookmark.lua diff --git a/lua/custom/plugins/bookmark.lua b/lua/custom/plugins/bookmark.lua new file mode 100644 index 0000000..2d87ae7 --- /dev/null +++ b/lua/custom/plugins/bookmark.lua @@ -0,0 +1,27 @@ +return { + 'tomasky/bookmarks.nvim', + event = { 'BufReadPre', 'BufNewFile' }, + config = function() + require('bookmarks').setup { + -- sign_priority = 8, + save_file = vim.fn.expand '$HOME/.bookmarks', + keywords = { + ['@t'] = '☑️ ', + ['@w'] = '⚠️ ', + ['@f'] = '⛏ ', + ['@n'] = ' ', + }, + on_attach = function(bufnr) + local bm = require 'bookmarks' + local map = vim.keymap.set + map('n', 'mm', bm.bookmark_toggle, { buffer = bufnr }) + map('n', 'mi', bm.bookmark_ann, { buffer = bufnr }) + map('n', 'mc', bm.bookmark_clean, { buffer = bufnr }) + map('n', 'mn', bm.bookmark_next, { buffer = bufnr }) + map('n', 'mp', bm.bookmark_prev, { buffer = bufnr }) + map('n', 'ml', bm.bookmark_list, { buffer = bufnr }) + map('n', 'mx', bm.bookmark_clear_all, { buffer = bufnr }) + end, + } + end, +}