From 8aab502cf634323aeb95e753252ce07c216a32e2 Mon Sep 17 00:00:00 2001 From: christiangun Date: Tue, 29 Apr 2025 13:13:14 +0200 Subject: [PATCH] Add bookmarks plugin --- lua/custom/plugins/bookmarks.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 lua/custom/plugins/bookmarks.lua diff --git a/lua/custom/plugins/bookmarks.lua b/lua/custom/plugins/bookmarks.lua new file mode 100644 index 00000000..2811f3a7 --- /dev/null +++ b/lua/custom/plugins/bookmarks.lua @@ -0,0 +1,22 @@ +return { + 'tomasky/bookmarks.nvim', + config = function() + require('bookmarks').setup { + on_attach = function(bufnr) + local bm = require 'bookmarks' + local map = vim.keymap.set + local telescope = require 'telescope' + map('n', 'mm', bm.bookmark_toggle) -- add or remove bookmark at current line + map('n', 'mi', bm.bookmark_ann) -- add or edit mark annotation at current line + map('n', 'mc', bm.bookmark_clean) -- clean all marks in local buffer + map('n', 'mn', bm.bookmark_next) -- jump to next mark in local buffer + map('n', 'mp', bm.bookmark_prev) -- jump to previous mark in local buffer + -- map('n', 'ml', bm.bookmark_list) -- show marked file list in quickfix window + map('n', 'ml', telescope.extensions.bookmarks.list) -- show marked file list in quickfix window + map('n', 'mx', bm.bookmark_clear_all) -- removes all bookmarks + end, + + pcall(require('telescope').load_extension, 'bookmarks'), + } + end, +}