Isrothy / neominimap.nvim

Yet another minimap plugin for Neovim
MIT License
169 stars 3 forks source link

Add `marks` in minimap #129

Closed echaya closed 2 months ago

echaya commented 2 months ago

Is your feature request related to a problem? Please describe. I'd like to visualize marks in the minimap which is available in satellite.nvim. I try to move to neominimap without needing to using 2 plugins providing similar functionalities.

Describe the solution you'd like Optionally display marks in the minimap or scrollbar

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. N/A

Additional context Add any other context or screenshots about the feature request here. N/A

I'm currently a satellite.nvim user; Starred it while back and glad to see how the plugin evolves (and love the looking of it). Would love to use it once supporting marks. Thank you!

Isrothy commented 2 months ago

Good idea. I'll implement this later.

Isrothy commented 2 months ago

Please checkout v3.5.0

echaya commented 1 month ago

Hey - thanks for adding the feature! However it seems I can't get it displayed within the minimap. I have tried override the vim.g.neominimap before and after calling require("neominimap").setup() non-working (I'm not using layzvim).

Isrothy commented 1 month ago

May I see your configuration file?

echaya commented 1 month ago

May I see your configuration file?

Just tried again, it is working beautifully but only when I have satellite installed! When I comment out "Plug 'lewis6991/satellite.nvim', I see the following error msg. Then I found local util = require("satellite.util") in your code. So I assume it requires satellite as dependency? If so, you should list it in the README.md

Error executing vim.schedule lua callback: ...m/plugged/neominimap.nvim/lua/neominimap/events/mark.lua:6: module 'satellite.util' not found:
    no field package.preload['satellite.util']
    no file '.\satellite\util.lua'
    no file 'd:\Dropbox\neovim\nvim-win64\bin\lua\satellite\util.lua'
    no file 'd:\Dropbox\neovim\nvim-win64\bin\lua\satellite\util\init.lua'
    no file '.\satellite\util.dll'
    no file 'd:\Dropbox\neovim\nvim-win64\bin\satellite\util.dll'
    no file 'd:\Dropbox\neovim\nvim-win64\bin\loadall.dll'
    no file '.\satellite.dll'
    no file 'd:\Dropbox\neovim\nvim-win64\bin\satellite.dll'
    no file 'd:\Dropbox\neovim\nvim-win64\bin\loadall.dll'
stack traceback:
    [C]: in function 'require'
    ...m/plugged/neominimap.nvim/lua/neominimap/events/mark.lua:6: in main chunk
    [C]: in function 'require'
    ...ugged/neominimap.nvim/lua/neominimap/buffer/autocmds.lua:146: in function 'create_mark_autocmds'
    ...ugged/neominimap.nvim/lua/neominimap/buffer/autocmds.lua:278: in function 'create_autocmds'
    ...m/plugged/neominimap.nvim/lua/neominimap/buffer/init.lua:4: in function 'create_autocmds'
    ...ovim\plugged\neominimap.nvim/lua/neominimap/autocmds.lua:8: in function 'create_autocmds'
    ...lugged/neominimap.nvim/lua/neominimap/command/global.lua:15: in function 'open_minimap'
    ...lugged/neominimap.nvim/lua/neominimap/command/global.lua:58: in function 'impl'
    ...ropbox\neovim\plugged\neominimap.nvim/lua/neominimap.lua:12: in function 'on'
    ...ropbox\neovim\plugged\neominimap.nvim/lua/neominimap.lua:124: in function 'fn'
    vim/_editor.lua:351: in function <vim/_editor.lua:350>

Separately, not sure if this will be of much work, can I suggest:

  1. Show lables for staged lines which is shown by gitsign in a color diff from before staged
  2. Connect dots for git changes (so it is consistent
  3. Show both marks and gitsigns
Isrothy commented 1 month ago

The dependency of satellite is solved.

  1. Infeasible because gitsigns doesn't have an API to differentiate between staged hunks and unstaged hunks.
  2. What do you mean by "connect the dots"?
  3. You can do this. One way to achieve this is
    winopt = function(wo)
    wo.signcolumn = "yes:2"
    end,

    Or you can check out this

echaya commented 1 month ago

Thanks. Plz refer to the pic below:

Re 2: You see the signs on the left by gitsigns are in staight lines, neominimap shows dot-dot-dot. Also somehow the colors are not matching.

Re 3: yes I have "yes:2" for my signcolumn, I wanted to see if I could set the same within minimap (I guess not?).

image

echaya commented 1 month ago

FWIW, showing git status and marks simultaneously is supported in satellite.

image

Isrothy commented 1 month ago

In your minimap configuration, add these:

winopt = function(wo)
    wo.signcolumn = "yes:2"
end,
git = {
    enabled = true,
    mode = "icon",
    icon = {
        add = "│",
        change = "│",
        delete = "-",
    },
},
Isrothy commented 1 month ago

If your want to change the highlight color of gitsigns, set the following highlights manually: NeominimapGitAddLine
NeominimapGitChangeLine NeominimapGitDeleteLine NeominimapGitAddSign
NeominimapGitChangeSign NeominimapGitDeleteSign NeominimapGitAddIcon
NeominimapGitChangeIcon NeominimapGitDeleteIcon

echaya commented 1 month ago

Thanks much. Let me try the above out.

Re the highlight groups, it would be ppl's expectation to link your color groups to what gitsigns.nvim been using given the dependency :)

echaya commented 1 month ago

In your minimap configuration, add these:

winopt = function(wo)
    wo.signcolumn = "yes:2"
end,
git = {
    enabled = true,
    mode = "icon",
    icon = {
        add = "│",
        change = "│",
        delete = "-",
    },
},

git icons work as expected.

Setting wo.signcolumn = "yes:2" will expand the width of signcolumn within the minimap but still can't separeted marks from git status.

Isrothy commented 1 month ago

In this case, you may want to use statuscol. See this