Giter VIP home page Giter VIP logo

bookmarks.nvim's People

Contributors

crusj avatar dreammaomao avatar konosubakonoakua avatar mesabytes avatar peiweihu avatar salfum avatar ttytm avatar xlboy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bookmarks.nvim's Issues

Ideas welcome. 🥳

Bookmark are realized by storing the file name and line number where the bookmark is added.
If the buf changes, the line number where the bookmark content is located may not match the real situation, the bookmark still points to the old one. Some time ago, I recorded the hash value of the line text where the bookmark is located. When the buf is saved, it will traverse all the bookmarks of the current buf, relative to the change of the total number of lines in the buf, look up or down for the line content equal to the bookmark hash value, and update the bookmark position, which works somewhat, but often fails. The fix_enable option is set to false by defalut.
I'm thinking of a better way to do it. 🤔
Ideas welcome. 🥳

Why not anchor bookmarks to a tree-sitter query?
Maybe as an optional requirement since I guess not everyone would want a bookmark plugin depending on tree-sitter

使用lsp提供的项目根目录

之前提过一个issue发现项目的工作路径(cwd)一直变化,原来是mhinz/vim-startify.git"这款插件的问题,会把打开的文件所在的路径自动变为当前的工作路径,但是neo-tree等其实都是按照项目根目录来渲染的(向上寻找.git目录等)。

  1. 所以是不是可以加个选项,允许优先基于lsp返回的项目根路径创建书签集合会更好?
    main...onns:bookmarks.nvim:main

  2. 然后lazy.nvim的默认定位跳转是ctrl i/ ctril o,查了一下tab在历史上输入和shift i是等效的,所以就会导致一个问题,如果用<tab><tab>做快捷键,会顶掉代码跳转的快捷键,在tmux场景下会失效。

and 给你发邮件木有回,感谢提供此插件!

missing icons

Hi and big thanks for this plugin!

Im missing icons and I suspect its caused by missing fonts.

What fonts is bookmarks.nvim expect me to have installed?

Filetype detection in preview windows

Related to #18.

In window.lua, it's assumed that the file extension is a valid treesitter filetype (for syntax highlighting) - which doesn't hold.

Consequently, if preview_ext_enable = true and the file with bookmarks doesn't have an extension, the following error occurs upon spawning the bookmarks window, as well as scrolling to different items (J or K), deleting bookmarks (dd), (non-exhaustive list) once every time.

Error detected while processing CursorMoved Autocommands for "<buffer=10>":
Error executing lua callback: ...local/share/nvim/lazy/bookmarks/lua/bookmarks/window.lua:180: E474: Invalid argument
stack traceback:
        [C]: in function 'nvim_buf_set_option'
        ...local/share/nvim/lazy/bookmarks/lua/bookmarks/window.lua:180: in function 'preview_bookmark'
        ...local/share/nvim/lazy/bookmarks/lua/bookmarks/window.lua:32: in function <...local/share/nvim/lazy/bookmarks/lua/bookmarks/window.lua:17>

Also, if the extension doesn't match the treesitter filetype (e.g. with py and python), the preview window won't be highlighted (though I think you've already accounted for this).

I'm not sure what the best way to go about this would be; quoting @tobealive from #18,

[...] it might be worth the tradeoff to additionally save ft = vim.bo.ft on bookmark creation

is an interesting idea. Or, the way neo-tree have done previews might be interesting - I don't notice a performance loss there personally.

I wish I could offer more information or help, but I'm fairly new to lua 😅

Possible bug concerning config item virt_pattern

virt_pattern is limited to five items. In the file bookmarks.nvim/lua/bookmarks/config.lua, tables are being copied item by item. This makes sense for keymap and hl. They have defined membership.

virt_pattern is open ended.

Changing line bookmarks.nvim/lua/bookmarks/config.lua#35 to:
if type(dv) ~= "table" or dk == 'virt_pattern' then
copies all items.

Bookmark view toggle window does not respect window close event

If you toggle the bookmarks view, and then issue :close<cr>. The cursor will return to the buffer under the floating window, but the floating window will remain. If you toggle the bookmarks view again, a new one is overlaid on top of the previous floating window, and toggling it closed will close itself, and only the right side of the original floating window.

I think this is counter-intuitive. Most libraries that use floating windows allow the window to be closed by normal means. The fact that the only way to close the floating window once you accidentally deviate from the toggle-to-close and use :close, is to restart neovim, should make this a high priority simple fix.

Thank you for the wonderful library by the way. I appreciate all your work!

Persist idea

You can use nvim_buf_get_extmarks to get those changed line numbers and get the new line location, no need for hash I think.

markdown file preview error

When bookmarking a markdown file I get a treesitter error every time I open my bookmark view, the error in question is 'no parser for "md" language', I tried recreating this with other plugins that use a preview window ( like telescope ) but it only appears in this plugin ( see attachment for full error message )
Screenshot_2023-11-19-10-48-48_3840x1080

Feature request: global bookmarks

Apologies if this is available and I didn't RTFM correctly but would love if there was an option for global bookmarks that could be postpended to the local ones. I often need to jump to specific locations without wanting to switch workspaces (e.g. add a hotkey while working on another file). Global bookmarks (ideally enabled via separate hotkey) would be brilliant.

Thanks a ton for the amazing plugin!

Syntax highlighting / Set filetype for previewed file in bookmarks float window

Currently, no filetype is set for a previewed filed. Setting the ft would enable syntax highlighting.

I didn't made any implementation test yet, so my theoretical assumptionion on how this could be solved: It might be possible to directly retrieve the filetype when opening the preview. If not, it might be worth the tradeoff to additionally save ft = vim.bo.ft on bookmark creation.

Screenshot, manually setting the ft in a previewed file after opening the window.

Screenshot_20230410_114726

Might be related to #13 (edit: didn't read through the issue properly. No relation afaik.)

Call 'split' for nil value

How to reproduce

  • git clone of the plugin
  • add default configuration (from README)
  • open any file in nvim (terminal or GUI)
  • add two bookmarks by '\\z'
  • open bookmarks list by <tab><tab>

image

How to customize the storage path?

As mentioned in the title, I want to set the location where the bookmark information is stored, instead of the default .local/share/nvim/bookmarks

Error message on adding bookmark

Reproduce:

  • open js-file
  • jump to line does not include 'require' word
  • add bookmark - works properly
  • jump to line with 'require'
  • add bookmark - error message, bookmark is not added
    Sometimes the error on line without 'require'

Screenshot: try add bookmark when cursor on line 'let qweqwe...'
image

Signs in signcolum option

Thanks for the work, the plugin is awesome!

If it's not too much hassle, I'd love to have an option to display bookmark sings in the singcolumn.

Screenshot_20230409_142744

If a PR is of any help, I have some time next month to submit something.

bookmarks data split by cwd may not be a good choice I think?

Thanks for developing such a good plugin, I wanna use bookmarks because I need to read a large project, understand how data transfer from one method to another, maybe many files in different folders. Saving bookmarks to different pwd makes hard to search.
For me, I use coc.vim to auto complete so, it has vim.g.WorkspaceFolders to help me locate the root path of my project. Also, nvim.fn.find_root_directory(start_directory, marker_file) can help us find the root path without lsp, they are similar by the way.

 local root_directory = nvim.fn.find_root_directory(cwd, ".git")

Maybe this is better for searching?

Feature: Support categorizing bookmarks into different workspaces

Thanks for your excellent work which eases my work a lot.

After using it for a while, I have a small suggestion. It would be cool if the plugin supports grouping bookmarks into different workspaces. Currently, all bookmarks, even those belonging to different projects, will be presented together.

One possible solution may be to add a new switchable tab showing the name of the current workspace in the leftmost column.

Highlight groups for bookmark window

It would be great to have the possibility to highlight the bookmark preview window and define border styles. For me it would provide consistent border style with the rest of the config.

E.g. in terms of highlights, the bookmarks window could use the "FloatBorder" and "FloatTitle" highlights.

Styles could be common predefined styles("single", "rounded", "dobule") or/and a custom set of characters.

Screenshot_20230409_143231

Screenshot_20230409_143239

Let me know if a PR would be of any help 👍

Invalid escape sequence near ''C:'

Environment:
neovim 0.9
Neovide GUI
Windows 11

After add bookmark, a file named "C" generated in the nvim-data/bookmarks folder, 0 byte size.
close nvim and open t again, the error pops.
the path of the file added to bookmark is some kind of "C:\path\file".
Guess the error refers to the path format on Windows OS.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.