r/neovim • u/4r73m190r0s • 19h ago
Random Neovim 0.12.7 released
183
Upvotes
r/neovim • u/NazgulResebo • 17h ago
I'm using this tiny marks config (just 14 lines). What do you think? Is it better to just use the picker from Telescope/Fzf, or should we go with the barebones approach (:marks and m + LETTER)?
Anyway, I'm surprised by how easy it is to build a mark picker using the Neovim API!
-- set mark mLETTER
-- show marks sm
local function show_marks()
local marks = vim.fn.getmarklist()
local list = vim.tbl_map(function(m)
return m.mark .. " -> " .. m.file
end, marks)
vim.ui.select(list, { prompt = "Marks" }, function(item, index)
if index == nil then return end
vim.cmd("normal! " .. marks[index].mark)
end)
end
vim.keymap.set("n", "sm", show_marks)