tomasky / bookmarks.nvim Goto Github PK
View Code? Open in Web Editor NEWA Bookmarks Plugin With Global File Store For Neovim Written In Lua.
License: MIT License
A Bookmarks Plugin With Global File Store For Neovim Written In Lua.
License: MIT License
I think that's some good work presented in this plugin.
If it's not to bothering for you i'd submit it to awsome neovim for you, to expose it to a larger user base.
Though that'd be useful if you could see the bookmarks comments as toggle scratchpad text instead of having to open the telescope bookmarks list everytime to want to reveal the bm text and that might be quite eay to do with some prior similar experience(for some of us...)
Is it possible to give an option to save booksmarks per project also instead of global scope.
Failed to run `config` for bookmarks.nvim
...l/share/nvim/lazy/bookmarks.nvim/lua/bookmarks/async.lua:45: The coroutine failed with this message: .../share/nvim/lazy/bookmarks.nvim/lua/bookmarks/config.lua:52: attempt to call global 'warn' (a nil value)
stack traceback:
.../share/nvim/lazy/bookmarks.nvim/lua/bookmarks/config.lua: in function 'validate_config'
.../share/nvim/lazy/bookmarks.nvim/lua/bookmarks/config.lua:73: in function 'build'
.../.local/share/nvim/lazy/bookmarks.nvim/lua/bookmarks.lua:67: in function <.../.local/share/nvim/lazy/bookmarks.nvim/lua/bookmarks.lua:66>
return {
"tomasky/bookmarks.nvim",
event = "VeryLazy",
config = function()
require("bookmarks").setup {
on_attach = function(bufnr)
local bm = require "bookmarks"
local map = vim.keymap.set
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
end,
require("telescope").load_extension "bookmarks",
}
end,
}
It would be helpful to have an action that deletes all marks in all buffers.
First of all, I love this plugin and use it daily for keeping track of and jumping around different large codebases.
I often create bookmarks for functions or structs, and if would as such be great if bookmarks could use treesitter or similar to look up the name of the current function/ident and prefill the popup for the bookmark name with the ident of it.
Thank you
The notes we add to the mark are being trimmed too much.
Is it hardcoded here for 30 chars?
https://github.com/tomasky/bookmarks.nvim/blob/main/lua/telescope/_extensions/bookmarks.lua#L40
It would be great to have them named and allow to configure them individually.
The icons not update/refresh before terminal focus will lost.
OS: Linux, OsX
Terminal: Iterm2, alacritty
The icons isn't load when file is open.
The icons not change after was edited by "mi"
Add/Remove new mark is worked normally.
After file was opened, or icon was changed by "mi" @f
need to lost focus of terminal and return. For example Alt+Tab or mouse action.
After this action all icons is loaded and updated.
Save file e.t.c. doesn't help.
Would be awesome to have a telescope action to delete a bookmark.
Thanks for this plugin, wouldn't have found it if it wasn't just listed recently (#1).
I noticed that the signs (in the signcolumn) do not appear on initial startup. The bookmarks are there and work for going to the next bookmark, but the signs only appear after you switch to a different buffer and then switch back.
I have tried it without lazyloading, still the same issue. I also tried disabling other plugins that add things to the signcolumn (e.g. gitsigns) in case of conflicts there, but the issue persists even then
Sometimes, I do forget that I have placed bookmarks in the current file. Such a statusline component might be useful as a reminder for that?
Enjoying my emoji bookmarks ๐ฏ ๐
Also when I try to use the telescope picker, I see:
E5108: Error executing lua ...scope.nvim/lua/telescope/previewers/buffer_previewer.lua:41: attempt to index local 'opts' (a nil value)
stack traceback:
...scope.nvim/lua/telescope/previewers/buffer_previewer.lua:41: in function 'qflist_previewer'
...y/bookmarks.nvim/lua/telescope/_extensions/bookmarks.lua:68: in function 'list'
[string ":lua"]:1: in main chunk
Maybe there is something wrong with my mapping, or I am failing to pass in default opts somewhere? I'm in lazyvim btw, and fairly new to the plugin setup style
https://www.lazyvim.org/extras/util/project
Notably, telescope opts is set to nil (?), but I'm not seeing this issue with other plugins. Let me know if I should send this to Telescope or Lazyvim..
Thanks ๐ค
-- Overriding editor.lua for better grep with telescope, fzf
local Util = require("lazyvim.util")
return {
{
"nvim-telescope/telescope.nvim",
config = function()
local actions = require("telescope.actions")
require("telescope").setup({
defaults = {
mappings = {
i = {
["<esc>"] = actions.close,
["<c-j>"] = actions.move_selection_next,
["<c-k>"] = actions.move_selection_previous,
},
},
},
})
end,
dependencies = {
...
{
"tomasky/bookmarks.nvim",
config = function()
require("bookmarks").setup({
-- sign_priority = 8, --set bookmark sign priority to cover other sign
save_file = vim.fn.expand("$HOME/.bookmarks"), -- bookmarks save file path
keywords = {
-- You can just copy these from emoji keyboard in browser (since it's using same font)
["@t"] = "๐ฅ", -- mark annotation startswith @t ,signs this icon as `Todo`
["@w"] = "โ ๏ธ ", -- mark annotation startswith @w ,signs this icon as `Warn`
["@f"] = "โ ", -- mark annotation startswith @f ,signs this icon as `Fix`
["@n"] = "๐ง ", -- mark annotation startswith @n ,signs this icon as `Note`
},
on_attach = function(bufnr)
local keymap = vim.keymap.set
local bm = require("bookmarks")
keymap("n", "<leader>mm", bm.bookmark_toggle, { desc = "# Toggle Emoji Bookmark" })
keymap("n", "<leader>mi", bm.bookmark_ann, { desc = "# Change annotation" })
keymap("n", "<leader>mc", bm.bookmark_clean, { desc = "# Clean all marks in buffer" })
keymap("n", "<leader>mn", bm.bookmark_next, { desc = "# Jump to next mark in buffer" })
keymap("n", "<leader>mp", bm.bookmark_prev, { desc = "# Jump to prev mark in buffer" })
keymap("n", "<leader>mq", bm.bookmark_list, { desc = "# Show marked file list in quickfix window" })
require("telescope").load_extension("bookmarks")
keymap(
"n",
"<leader>ml",
[[:lua require("telescope").extensions.bookmarks.list()<cr>]],
{ desc = "# Telescope bookmarks list" }
)
end,
})
end,
},
},
...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.