Coder Social home page Coder Social logo

neo-minimap's Introduction

YouTube

TypeScript React HTML5 CSS3 Lua Rust



neo-minimap's People

Contributors

desdic avatar dtomvan avatar has2k1 avatar thesafdarawan avatar ziontee113 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

neo-minimap's Issues

Highlight group

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).

Can we have more styling options?

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!

`<C-v>` raises an error in other buffers than neo-minimap

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 :

  • Open any file that can be used with neo-minimap
  • Open the neo-minimap window
  • Close the neo-minimap window
  • Make a block selection with <C-v>

From what I understand it seems that when the neo-minimap window is closed, the autocommands/keymaps are not "deleted".

Unhighlight search when close minimap

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)

`neo-minimap` version 2

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 !

which-key support or a way to add keymaps separately

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
    }
})

throws error if search not found

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}
     },

feat: Allow the user to dynamically set `open_win_opts`

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,
})

use of neo-minimap in .tex files

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

Deprecated treesitter functions

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]

Typo in 'disable_indentaion' option

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.

Want a global setting

I could like to have a global setting for things like height_toggle, win_opts, etc. You know, this will be convenient.

Displaying multiline matches in the minimap?

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:

  1. given the way you've designed this plugin, would this be possible?
  2. does a way already exist?

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!

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.