ziontee113 / neo-minimap Goto Github PK
View Code? Open in Web Editor NEWPlugin for Neovim that lets you create your own "minimap" from Treesitter Queries or Vim Regex.
License: MIT License
Plugin for Neovim that lets you create your own "minimap" from Treesitter Queries or Vim Regex.
License: MIT License
I think the hi group for floating windows should be NormalFloat
instead of Normal
and for line number should be LineNr
or CursorLineNr
instead of DiagnosticWarn
. I think this makes more sense (at least for me).
Hi! I really like the idea of this plugin and I think I will use it often. :)
Could you add (in the future, not necessary now) more configuration options for styling the minimap window? You know, some basic staff like highlight groups, borders etc. ? Basically, things that go into nvim_win_set_option and nvim_open_win.
Thanks in advance!
Hi !
With the latest commits from master
, using <C-v>
raises the error below after opening/closing the neo-minimap
window at least once.
E5108: Error executing lua: ...e/pack/github/start/neo-minimap/lua/neo-minimap/init.lua:233: Invalid window id: 1006
stack traceback:
[C]: in function 'nvim_win_call'
...e/pack/github/start/neo-minimap/lua/neo-minimap/init.lua:233: in function <...e/pack/github/start/neo-minimap/lua/neo-minimap/init.lua:231>
Steps to reproduce :
neo-minimap
neo-minimap
windowneo-minimap
window<C-v>
From what I understand it seems that when the neo-minimap
window is closed, the autocommands/keymaps are not "deleted".
Feature request.
After search in neo-minimap window (with /
), the found item is highlighted. It left highlighted after it selected and minimap closed.
Please add option (or hard-coded) to hide the highlight. Something like this:
vim.keymap.set("n", "<CR>", function()
jump_and_zz(line_data, opts)
+ vim.cmd([[nohlsearch]], false)
vim.api.nvim_win_close(win, true)
This is not an issue but only a post to say thank you and get more infos about the version 2.
So thank you for this amazing plugin !
I'm tired of vertical scrolling and I was about to start using folds for some codes because the files have too many lines.
I never liked folds and your plugin definitely make them even more useless for me !!! ;p
Your plugin is one of the few plugins I use that really helps me improve my workflow !
I saw there is a version_2
branch.
I have quickly read the files and I find the new version way more clean/readable than the current one.
I also found that there is a "jumper" feature and I'm very excited for this.
The current way to set keymaps with the order of queries and regex is a bit confusing for me.
I had to rewatch your youtube video to understand how it works.
Do you plan to simplify the configuration in the version_2
?
Do you plan to use queries from separate files ? <neovim_config_dir>/queries/lua/neo-minimap.scm
What is the current state of version_2
?
Again, thank you for this plugin !
I would like to have a way to add the treesitter queries without having to register a keymap. Based on the filetype, it will show the relevant captures.
nm.set('filetype', {
query = [[
;; query
((query_goes_here) @cap)
]],
})
wk.register({
['<leader>'] = {
n = { nm.open, 'Open mini map' }
... = ... other keymaps
}
})
Hi !
Is there a simple way to avoid displaying line numbers in the neo-minimap
window ?
It would be nice to have an option to disable this.
very nice plugin ! I did find a small error when using search patterns that does not exists
E5108: Error executing lua: ...e/pack/packer/start/neo-minimap/lua/neo-minimap/init.lua:292: Vim:E486: Pattern not found: function
stack traceback:
[C]: in function 'cmd'
...e/pack/packer/start/neo-minimap/lua/neo-minimap/init.lua:292: in function <...e/pack/packer/start/neo-minimap/lua/neo-minimap/init.lua:289>
if I define search patterns and they do not exist and I use the search patterns its throwing an error
search_patterns = {
{"function", "<C-j>", true}, {"function", "<C-k>", false},
{"keymap", "<A-j>", true}, {"keymap", "<A-k>", false}
},
Hi !
Is this possible to let the user define the open_win_opts
option from a function ?
It would help the user define custom position/size.
If needed, I did it on my fork here in the feat-open_win_opts_function
branch here.
Here is what I use :
local function get_open_win_opts()
local win_id = vim.api.nvim_get_current_win()
local win_width = vim.api.nvim_win_get_width(win_id)
local win_height = vim.api.nvim_win_get_height(win_id)
local open_win_height = math.floor(win_height * 0.4)
return {
relative = "win",
win = win_id,
border = { "", "โ", "", "", "", "", "", "" },
row = win_height - open_win_height - 1,
col = 0,
width = win_width,
height = open_win_height,
}
end
neo_minimap.setup_defaults({
auto_jump = true,
disable_indentaion = false,
events = { "BufEnter" },
hl_group = "LineNr",
open_win_opts = get_open_win_opts,
query_index = 1,
width = 44,
})
Hi, I am trying to run the plugin in *.tex files but I have the following error "E490: no fold found", any suggestion?, in other languages it works fine
The vim.treesitter.parse_query is deprecated in neovim 0.9 and will be removed in 0.10.
Possible solution:
diff --git a/lua/neo-minimap/init.lua b/lua/neo-minimap/init.lua
index c58ea9f..ff09a7a 100644
--- a/lua/neo-minimap/init.lua
+++ b/lua/neo-minimap/init.lua
@@ -130,7 +130,13 @@ local function __buffer_query_processor(opts)
current_query = current_query:gsub("%{cursorword}", opts.cursorword)
end
- local ok, iter_query = pcall(vim.treesitter.query.parse_query, opts.filetype, current_query)
+ local parse_query
+ if vim.treesitter.query.parse then
+ parse_query = vim.treesitter.query.parse
+ else
+ parse_query = vim.treesitter.parse_query
+ end
+ local ok, iter_query = pcall(parse_query, opts.filetype, current_query)
if ok then
for _, matches, _ in iter_query:iter_matches(root, current_buffer) do
local match = matches[1]
Hi !
I noticed a typo in the option name : disable_indentaion > disable_indentation
If needed, I fixed it on my fork here in the fix-typo_disable_indentaoin
branch here.
I could like to have a global setting for things like height_toggle
, win_opts
, etc. You know, this will be convenient.
I'm building up a set of treesitter queries for using neo-minimap in Rust. I'm not sure how familiar you are with the language, but in modules, test functions are marked by an attribute:
#[test]
fn this_does_something() {
...
}
I've built a query that I believe captures this
(((attribute_item) @attr (function_item) @cap (#vim-match? @attr "test")))
but in the minimap window, I only see the first line of each match, so it looks like
89 #[test]
97 #[test]
103 #[test]
etc...
I haven't found an obvious (or any) way to specify which line (or maybe more simply all the lines) of a multiline match a rule should display in the minimap window, so I have two and a half questions:
If the answer to both is yes, any guidance you can offer on how to configure my rules would be very welcome.
If the answer to 1 is yes but 2 is a no, unless this is something you're actively working on I'd be happy to try to write a patch to add that functionality.
If the answer to 1 is no, then I will figure out a workaround for my use case, and thank you for building a tool that gets me 99% of the way to where I want to be!
I just use which-key to show key maps, but I don't know how to add a description to a keymap. Is there any interface or mathods? Thanks
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.