Giter VIP home page Giter VIP logo

nvim-hlslens's Introduction

nvim-hlslens

nvim-hlslens helps you better glance at matched information, seamlessly jump between matched instances.

hlslens-demo.mp4

Table of contents

Features

  • Fully customizable style of virtual text
  • Clear highlighting and virtual text when cursor is out of range
  • Display search result dynamically while cursor is moving
  • Display search result for the current matched instance while searching
  • Display search result for some built-in commands that support incsearch (need Neovim 0.8.0)

Need vim.api.nvim_parse_cmd to parse built-in commands if incsearch is enabled.

Quickstart

Requirements

Installation

Install nvim-hlslens with Packer.nvim:

use {'kevinhwang91/nvim-hlslens'}

Minimal configuration

require('hlslens').setup()

local kopts = {noremap = true, silent = true}

vim.api.nvim_set_keymap('n', 'n',
    [[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]],
    kopts)
vim.api.nvim_set_keymap('n', 'N',
    [[<Cmd>execute('normal! ' . v:count1 . 'N')<CR><Cmd>lua require('hlslens').start()<CR>]],
    kopts)
vim.api.nvim_set_keymap('n', '*', [[*<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('n', '#', [[#<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('n', 'g*', [[g*<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('n', 'g#', [[g#<Cmd>lua require('hlslens').start()<CR>]], kopts)

vim.api.nvim_set_keymap('n', '<Leader>l', '<Cmd>noh<CR>', kopts)

Usage

After using Minimal configuration:

Hlslens will add virtual text at the end of the line if the room is enough for virtual text, otherwise, add a floating window to overlay the statusline to display lens.

You can glance at the result provided by lens while searching when incsearch is on. Hlslens also supports <C-g> and <C-t> to move to the next and previous match.

Start hlslens

  1. Press / or ? to search text, /s and /e offsets are supported;
  2. Invoke API require('hlslens').start();

Stop hlslens

  1. Run ex command nohlsearch;
  2. Map key to :nohlsearch;
  3. Invoke API require('hlslens').stop();

Documentation

Setup and description

{
    auto_enable = {
        description = [[Enable nvim-hlslens automatically]],
        default = true
    },
    enable_incsearch = {
        description = [[When `incsearch` option is on and enable_incsearch is true, add lens
            for the current matched instance]],
        default = true
    },
    calm_down = {
        description = [[If calm_down is true, clear all lens and highlighting When the cursor is
            out of the position range of the matched instance or any texts are changed]],
        default = false,
    },
    nearest_only = {
        description = [[Only add lens for the nearest matched instance and ignore others]],
        default = false
    },
    nearest_float_when = {
        description = [[When to open the floating window for the nearest lens.
            'auto': floating window will be opened if room isn't enough for virtual text;
            'always': always use floating window instead of virtual text;
            'never': never use floating window for the nearest lens]],
        default = 'auto',
    },
    float_shadow_blend = {
        description = [[Winblend of the nearest floating window. `:h winbl` for more details]],
        default = 50,
    },
    virt_priority = {
        description = [[Priority of virtual text, set it lower to overlay others.
        `:h nvim_buf_set_extmark` for more details]],
        default = 100,
    },
    override_lens  = {
        description = [[Hackable function for customizing the lens. If you like hacking, you
            should search `override_lens` and inspect the corresponding source code.
            There's no guarantee that this function will not be changed in the future. If it is
            changed, it will be listed in the CHANGES file.
            @param render table an inner module for hlslens, use `setVirt` to set virtual text
            @param splist table (1,1)-indexed position
            @param nearest boolean whether nearest lens
            @param idx number nearest index in the plist
            @param relIdx number relative index, negative means before current position,
                                  positive means after
        ]],
        default = nil
    },
}

Highlight

hi default link HlSearchNear IncSearch
hi default link HlSearchLens WildMenu
hi default link HlSearchLensNear IncSearch
  1. HlSearchLensNear: highlight the nearest virtual text for the floating window
  2. HlSearchLens: highlight virtual text except for the nearest one
  3. HlSearchNear: highlight the nearest matched instance

Commands

  • HlSearchLensToggle: Toggle nvim-hlslens enable/disable
  • HlSearchLensEnable: Enable nvim-hlslens
  • HlSearchLensDisable: Disable nvim-hlslens

API

hlslens.lua

Advanced configuration

Customize configuration

require('hlslens').setup({
    calm_down = true,
    nearest_only = true,
    nearest_float_when = 'always'
})

-- run `:nohlsearch` and export results to quickfix
-- if Neovim is 0.8.0 before, remap yourself.
vim.keymap.set({'n', 'x'}, '<Leader>L', function()
    vim.schedule(function()
        if require('hlslens').exportLastSearchToQuickfix() then
            vim.cmd('cw')
        end
    end)
    return ':noh<CR>'
end, {expr = true})
hlslens-customize.mp4

Customize virtual text

require('hlslens').setup({
    override_lens = function(render, posList, nearest, idx, relIdx)
        local sfw = vim.v.searchforward == 1
        local indicator, text, chunks
        local absRelIdx = math.abs(relIdx)
        if absRelIdx > 1 then
            indicator = ('%d%s'):format(absRelIdx, sfw ~= (relIdx > 1) and '' or '')
        elseif absRelIdx == 1 then
            indicator = sfw ~= (relIdx == 1) and '' or ''
        else
            indicator = ''
        end

        local lnum, col = unpack(posList[idx])
        if nearest then
            local cnt = #posList
            if indicator ~= '' then
                text = ('[%s %d/%d]'):format(indicator, idx, cnt)
            else
                text = ('[%d/%d]'):format(idx, cnt)
            end
            chunks = {{' '}, {text, 'HlSearchLensNear'}}
        else
            text = ('[%s %d]'):format(indicator, idx)
            chunks = {{' '}, {text, 'HlSearchLens'}}
        end
        render.setVirt(0, lnum - 1, col - 1, chunks, nearest)
    end
})

Integrate with other plugins

-- packer
use 'haya14busa/vim-asterisk'

vim.api.nvim_set_keymap('n', '*', [[<Plug>(asterisk-z*)<Cmd>lua require('hlslens').start()<CR>]], {})
vim.api.nvim_set_keymap('n', '#', [[<Plug>(asterisk-z#)<Cmd>lua require('hlslens').start()<CR>]], {})
vim.api.nvim_set_keymap('n', 'g*', [[<Plug>(asterisk-gz*)<Cmd>lua require('hlslens').start()<CR>]], {})
vim.api.nvim_set_keymap('n', 'g#', [[<Plug>(asterisk-gz#)<Cmd>lua require('hlslens').start()<CR>]], {})

vim.api.nvim_set_keymap('x', '*', [[<Plug>(asterisk-z*)<Cmd>lua require('hlslens').start()<CR>]], {})
vim.api.nvim_set_keymap('x', '#', [[<Plug>(asterisk-z#)<Cmd>lua require('hlslens').start()<CR>]], {})
vim.api.nvim_set_keymap('x', 'g*', [[<Plug>(asterisk-gz*)<Cmd>lua require('hlslens').start()<CR>]], {})
vim.api.nvim_set_keymap('x', 'g#', [[<Plug>(asterisk-gz#)<Cmd>lua require('hlslens').start()<CR>]], {})

The lens has been adapted to the folds of nvim-ufo, still need remap n and N action if you want to peek at folded lines.

-- packer
use {'kevinhwang91/nvim-ufo', requires = 'kevinhwang91/promise-async'}

-- if Neovim is 0.8.0 before, remap yourself.
local function nN(char)
    local ok, winid = hlslens.nNPeekWithUFO(char)
    if ok and winid then
        -- Safe to override buffer scope keymaps remapped by ufo,
        -- ufo will restore previous buffer keymaps before closing preview window
        -- Type <CR> will switch to preview window and fire `trace` action
        vim.keymap.set('n', '<CR>', function()
            return '<Tab><CR>'
        end, {buffer = true, remap = true, expr = true})
    end
end

vim.keymap.set({'n', 'x'}, 'n', function() nN('n') end)
vim.keymap.set({'n', 'x'}, 'N', function() nN('N') end)
hlslens-vm.mp4
-- packer
use 'mg979/vim-visual-multi'

local hlslens = require('hlslens')
if hlslens then
    local overrideLens = function(render, posList, nearest, idx, relIdx)
        local _ = relIdx
        local lnum, col = unpack(posList[idx])

        local text, chunks
        if nearest then
            text = ('[%d/%d]'):format(idx, #posList)
            chunks = {{' ', 'Ignore'}, {text, 'VM_Extend'}}
        else
            text = ('[%d]'):format(idx)
            chunks = {{' ', 'Ignore'}, {text, 'HlSearchLens'}}
        end
        render.setVirt(0, lnum - 1, col - 1, chunks, nearest)
    end
    local lensBak
    local config = require('hlslens.config')
    local gid = vim.api.nvim_create_augroup('VMlens', {})
    vim.api.nvim_create_autocmd('User', {
        pattern = {'visual_multi_start', 'visual_multi_exit'},
        group = gid,
        callback = function(ev)
            if ev.match == 'visual_multi_start' then
                lensBak = config.override_lens
                config.override_lens = overrideLens
            else
                config.override_lens = lensBak
            end
            hlslens.start()
        end
    })
end

Feedback

  • If you get an issue or come up with an awesome idea, don't hesitate to open an issue in github.
  • If you think this plugin is useful or cool, consider rewarding it a star.

License

The project is licensed under a BSD-3-clause license. See LICENSE file for details.

nvim-hlslens's People

Contributors

amirhhashemi avatar beauwilliams avatar kevinhwang91 avatar mars90226 avatar schoblaska 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  avatar  avatar  avatar

nvim-hlslens's Issues

Disable Nearest Highlight During Substitute

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

When doing substitution on a search map, the Nearest Highlight remains during the substitution.
For example,

    hl.TelescopePromptTitle = {
      bg = c.bg_dark,
      fg = c.fg_dark,
    }
    hl.TelescopePreviewTitle = {
      bg = c.bg_dark,
      fg = c.fg_dark,
    }

Screen Shot 2022-09-23 at 10 03 20 am

and in nvim:

/fg_dark
:%s//foo_bar_baz/g

(Where empty substitute pattern uses previous search)

I get:

Screen Shot 2022-09-23 at 9 43 42 am

I would like:

Screen Shot 2022-09-23 at 9 57 39 am

I think this can be achieved by possibly disabling hls-lens before substituting and re-enabling after, but I don't see any autocommands like SubstitueEnter and SubstituteLeave that could be used to hook into...

Integration with lualine

Is your feature request related to a problem? Please describe.

I'd like to disable virtual text but only show the contents of the virtual text for the nearest search in the status line.

Is there a way to get that information? I tried print(require'hlslens'.status()) but that just prints start.

Breaking Change

The current revision is breaking change.

If you are busy and don't have time to follow the current version. Please use tag in your plugin manager to stay in v0.1.0.

Here are the CHANGES:

nvim-hlslens/CHANGES

Lines 1 to 20 in ee089a7

CHANGES FROM 0.1.0 TO 0.2.0
* rename `HlSearchCur` to `HlSearchNear`.
* rename `HlSearchLensCur` to `HlSearchLensNear`.
* replace `override_line_lens` with `override_lens`.
* add `HlSearchFloat` highlight the nearest text for the floating window.
* add `nearest_only` option to add lens for the nearest instance and ignore others.
* add `nearest_float_when` and `float_shadow_blend` options for displaying nearest instance lens
with floating window.
* add `virt_priority` option to specify the priority of `nvim_buf_set_extmark`.
* add `enable_incsearch` option to display the current matched instance lens while searching.
* support `/s` and `/e` offsets for search, but don't support offset number.

Center text without disabling hlslens.

Feature

So i have have some hotkeys eg, nzzzv to keep each jump centered, issue is zz and zv will disable hlslense. I've made a function that does the same thing when pressing enter when finalizing my search with the same issue.

Resolve

a setting that enables this feature natively.

`calm_down` does not work with Asterisk

  • nvim --version: NVIM v0.6.1 / LuaJIT 2.1.0-beta3
  • Operating system/version: ArchLinux

Describe the bug

When the keymaps are configured to use Asterisk like this:

vim.api.nvim_set_keymap('n', '*', "<Plug>(asterisk-*)<Cmd>lua require('hlslens').start()<CR>", {})
vim.api.nvim_set_keymap('n', '#', "<Plug>(asterisk-#)<Cmd>lua require('hlslens').start()<CR>", {})
vim.api.nvim_set_keymap('n', 'g*', "<Plug>(asterisk-g*)<Cmd>lua require('hlslens').start()<CR>", {})
vim.api.nvim_set_keymap('n', 'g#', "<Plug>(asterisk-g#)<Cmd>lua require('hlslens').start()<CR>", {})

and the calm_down option is set to true, moving the text cursor out of the currently highlighted word does not disable the search highlighting.

Keep matched instance in the middle of the screen on jump

First of all, thank you for creating this useful plugin and sharing it with us. :)

Sometimes the scrolling is annoying depending on how many found instances you have. It would be nice to have a way to "lock" the search (offset) in the middle of the screen as you jump through them.

Error arithmetic on field 'end_col' (a nil value)

  • nvim --version:
    NVIM v0.6.0-dev+96-g5f01714b2
    Build type: Release
    LuaJIT 2.1.0-beta3

  • Operating system/version:
    MacOS

Describe the bug
Error message when search a text. arithmetic on field 'end_col' (a nil value)

To Reproduce using nvim -u mini.vim

Example:
cat mini.vim

" use your plugin manager, here is `vim-plug`
call plug#begin('~/.config/nvim/plugged')
Plug 'kevinhwang91/nvim-hlslens'

call plug#end()
lua require('hlslens').setup()
noremap <silent> n <Cmd>execute('normal! ' . v:count1 . 'n')<CR>
            \<Cmd>lua require('hlslens').start()<CR>
noremap <silent> N <Cmd>execute('normal! ' . v:count1 . 'N')<CR>
            \<Cmd>lua require('hlslens').start()<CR>
noremap * *<Cmd>lua require('hlslens').start()<CR>
noremap # #<Cmd>lua require('hlslens').start()<CR>
noremap g* g*<Cmd>lua require('hlslens').start()<CR>
noremap g# g#<Cmd>lua require('hlslens').start()<CR>

" use : instead of <Cmd>
nnoremap <silent> <leader>l :nohlsearch<CR>

Steps to reproduce the behavior:

  1. Search a string
  2. see error
Error executing vim.schedule lua callback: .../.config/nvim/plugged/nvim-hlslens/lua/hlslens/index.lua:135: attempt to perform
 arithmetic on field 'end_col' (a nil value)

Expected behavior
No error

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

invalid in command-line window errors

  • nvim --version:NVIM v0.5.0-dev+1327-gdc18c1e3e
  • Operating system/version: Arch Linux / Linux 5.12.4-arch1-2

Describe the bug
Searching text within the command-line window (q:) will trigger the following error
image

Steps to reproduce the behavior:

  1. Press q:
  2. Use ? to search within command-line window
  3. Witness the error

Expected behavior
Not sure if hlslens can work within the command-line window. Expected behavior would be for it to either work, or gracefully handle the error.

Support for `*`

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Would be very helpful to get virtual text highlights for occurrences of word under cursor with *.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Support for observing *.

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

calm_down is invalid often

  • nvim --version: v0.8.0

Describe the bug
I have set calm_down = true in my configuration for hlslens. However, it doesn't work very often.
In short, when the cursor moves out of the matched range, the lens is still there. (Not always, sometimes they can be clear.)

My configuration is very simple and references README.md.

local status, hlslens = pcall(require, "hlslens")
if not status then
  vim.notify("can not find hlslens")
  return
end

hlslens.setup({
  calm_down = true,
  override_lens = function(render, posList, nearest, idx, relIdx)
    local sfw = vim.v.searchforward == 1
    local indicator, text, chunks
    local absRelIdx = math.abs(relIdx)
    if absRelIdx > 1 then
      indicator = ('%d%s'):format(absRelIdx, sfw ~= (relIdx > 1) and '' or '')
    elseif absRelIdx == 1 then
      indicator = sfw ~= (relIdx == 1) and '' or ''
    else
      indicator = ''
    end

    local lnum, col = unpack(posList[idx])
    if nearest then
      local cnt = #posList
      if indicator ~= '' then
        text = ('[%s %d/%d]'):format(indicator, idx, cnt)
      else
        text = ('[%d/%d]'):format(idx, cnt)
      end
      chunks = {{' ', 'Ignore'}, {text, 'HlSearchLensNear'}}
    else
      text = ('[%s %d]'):format(indicator, idx)
      chunks = {{' ', 'Ignore'}, {text, 'HlSearchLens'}}
    end
    render.setVirt(0, lnum - 1, col - 1, chunks, nearest)
  end
})

To Reproduce using nvim -u mini.lua

Example:
cat mini.lua

-- packer
use {'kevinhwang91/nvim-hlslens'}

require('hlslens').setup()

local kopts = {noremap = true, silent = true}

vim.api.nvim_set_keymap('n', 'n',
    [[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]],
    kopts)
vim.api.nvim_set_keymap('n', 'N',
    [[<Cmd>execute('normal! ' . v:count1 . 'N')<CR><Cmd>lua require('hlslens').start()<CR>]],
    kopts)
vim.api.nvim_set_keymap('n', '*', [[*<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('n', '#', [[#<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('n', 'g*', [[g*<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('n', 'g#', [[g#<Cmd>lua require('hlslens').start()<CR>]], kopts)

vim.api.nvim_set_keymap('x', '*', [[*<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('x', '#', [[#<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('x', 'g*', [[g*<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('x', 'g#', [[g#<Cmd>lua require('hlslens').start()<CR>]], kopts)

vim.api.nvim_set_keymap('n', '<Leader>l', ':noh<CR>', kopts)

Steps to reproduce the behavior:

  1. search "hlslens" by type /hlslens<CR>
  2. move the cursor out of the matched range by type jj, and you can see that the cursor is on the third row in this screenshot. However, the lens are still here.
    image

Expected behavior
The lens can be clear if the cursor is out of the matched range.

Screenshots
See above.

Additional context
I set the native nvim configuration, idk whether they will affect hlslens.

vim.wo.cursorline = true
vim.o.hlssearch = true
vim.o.incsearch = true

redo is executed when issuing search using plugin

Hello, thank you for the plugin.
Im encountering weird problem, so i have this mapping: nnoremap <space>sn /<c-r><c-w><CR>, and when i use it, seems like it also executes :redo, here is the gif demonstrating it. After i do 5D, then u, then invoking search, :redo is executed without me pressing it, which deletes 5 row of 1's again.

Peek 2021-11-28 19-20

init.vim i use:

call plug#begin()
Plug 'kevinhwang91/nvim-hlslens'
call plug#end()

noremap <silent> n <Cmd>execute('normal! ' . v:count1 . 'n')<CR>
            \<Cmd>lua require('hlslens').start()<CR>
noremap <silent> N <Cmd>execute('normal! ' . v:count1 . 'N')<CR>
            \<Cmd>lua require('hlslens').start()<CR>
noremap * *<Cmd>lua require('hlslens').start()<CR>
noremap # #<Cmd>lua require('hlslens').start()<CR>
noremap g* g*<Cmd>lua require('hlslens').start()<CR>
noremap g# g#<Cmd>lua require('hlslens').start()<CR>

nnoremap <space>sn /<c-r><c-w><CR>
nnoremap <space>/ :noh<CR>

nvim --version: NVIM v0.6.0-dev+640-gb51b0aecc

It's a strange problem, why this might be happening?

Bug about ufo support

  • nvim --version: nightly
  • Operating system/version: arch linux

Describe the bug
Look at the video, the count increase;

screenrecorder-2022-12-30_23.10.24.mp4

To Reproduce using nvim -u mini.lua
Copied from the readme

-- packer
use {'kevinhwang91/nvim-ufo', requires = 'kevinhwang91/promise-async'}

-- if Neovim is 0.8.0 before, remap yourself.
local function nN(char)
    local ok, winid = hlslens.nNPeekWithUFO(char)
    if ok and winid then
        -- Safe to override buffer scope keymaps remapped by ufo,
        -- ufo will restore previous buffer keymaps before closing preview window
        -- Type <CR> will switch to preview window and fire `tarce` action
        vim.keymap.set('n', '<CR>', function()
            local keyCodes = api.nvim_replace_termcodes('<Tab><CR>', true, false, true)
            api.nvim_feedkeys(keyCodes, 'im', false)
        end, {buffer = true})
    end
end

vim.keymap.set({'n', 'x'}, 'n', function() nN('n') end)
vim.keymap.set({'n', 'x'}, 'N', function() nN('N') end)

Steps to reproduce the behavior:

  1. enter nvim and search a keyword only in one ufo fold
  2. pressing n

Expected behavior
Show the current count, 2 in the video

show only count option and disable jump labels?

Apologies If I am misunderstanding the options in the "Setup and description" section of the README.

If someone wanted to use this plugin without the jumping features is there a way to hide the [3N 2], [n 2] like tags, but leave the x/y results for the current line?

It seems like / + control g (do not hit enter) gives me the result I want, but using n/N is faster.

Context:
My Neovim is currently configured with "cmdheight = 0", being able to quickly search a log file to count for occurences of say an error string, is the main feature I find I have lost since using cmdheight = 0.

This plugin is working great to add that functionality back, but I am wanting to hide the jump tags so that I only get the info I need so it is cleaner.

Add doc about usage with vim-plug

When I try the following :

call plug#begin('~/.config/nvim/plugged')
Plug 'kevinhwang91/nvim-hlslens'
call plug#end()
lua require('hlslens').setup()

I get following error :

line  260:
E5108: Error executing lua [string ":lua"]:1: module 'hlslens' not found:
        no field package.preload['hlslens']
        no file './hlslens.lua'
        no file '/usr/share/luajit-2.1.0-beta3/hlslens.lua'
        no file '/usr/local/share/lua/5.1/hlslens.lua'
        no file '/usr/local/share/lua/5.1/hlslens/init.lua'
        no file '/usr/share/lua/5.1/hlslens.lua'
        no file '/usr/share/lua/5.1/hlslens/init.lua'
        no file './hlslens.so'
        no file '/usr/local/lib/lua/5.1/hlslens.so'
        no file '/usr/lib/x86_64-linux-gnu/lua/5.1/hlslens.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
        [C]: in function 'require'
        [string ":lua"]:1: in main chunk

It worked well a few months ago (can't tell when exactly it stopped working).

It would be great to add installation instruction for vim-plug.

Also, I'm not much used to using lua in my .vimrc, it would be great to tell more about where you are putting the following :

require('hlslens').setup()
local kopts = {noremap = true, silent = true}
....
...

(source : https://github.com/kevinhwang91/nvim-hlslens#minimal-configuration)

[bug] virtual text doesnt appear

  • nvim --version: 0.6
  • Operating system/version: manjaro 21 xfce ornara (arch linux)

Describe the bug
i dont get any virtual text on the searches even with pasted config from your readme

quick demo for you to see:

2021-09-24.23-33-18.mp4

i followed your instructions and for me virtual text doesnt appear just near the results.

nvim-hlslens need to invoke `require('nvim-hlslens').setup()` to boot!

  • nvim --version: NVIM v0.8.1
  • Operating system/version: Fedora Workstation 36

Describe the bug
Packer allows us to setup a plugin with the config option like this:

-- file lua/plugins.lua
return require("packer").startup(function(use)
	-- Packer can manage itself
	use("wbthomason/packer.nvim")

	use({
		"kevinhwang91/nvim-hlslens",
		config = function()
			require("hlslens").setup()
		end,
	})
end)

but when I call require("hlslens").setup() inside the config option this message appears: nvim-hlslens need to invoke require('nvim-hlslens').setup() to boot!

The message does not appear when I call it outside in other file like this:

-- file init.lua
require("plugins")
require("hlslens").setup()

Steps to reproduce the behavior:
Call require('hlslens').setup() inside the config options that packer.nvim provides.

Expected behavior
Call require('hlslens').setup() inside the config option that packer.nvim provides without errors.

Screenshots
20221202_22h50m06s_grim

segmentation fault

  • nvim --version: NVIM v0.8.0-dev+374-ge13dcdf16
  • Operating system/version: Arch Linux 5.18.3-arch1-1

Describe the bug
After pressing 'n' a certain number of times (it varies, sometimes it happens after 1, sometimes after around 4 or 5) after searching with /, nvim crashes with a segmentation fault.

Steps to reproduce the behavior:

  1. Search a term using /
  2. Press 'n' to look for the next one
  3. Repeat until neovim crashes

Expected behavior
Neovim not to crash

Option to add callback to lens instead of override_lens

Is your feature request related to a problem? Please describe.
Not really, but would like to make it cleaner to integrate with my own plugin.

Describe the solution you'd like
I was wondering if it would be possible for you to add something like "lens_callback" (similar to override_lens) but instead of overriding, it just calls the function instead

Unexpected redo's occur rarely

  • nvim --version:
NVIM v0.5.0-dev+1194-gc20ae3aad
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/Users/runner/work/neovim/neovim/build/config -I/Users/runner/work/neovim/neovim/src -I/Users/runner/work/neovim/neovim/.deps/usr/include -I/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include -I/Library/Frameworks/Mono.framework/Headers -I/Users/runner/work/neovim/neovim/build/src/nvim/auto -I/Users/runner/work/neovim/neovim/build/include
Compiled by [email protected]

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/share/nvim"

Run :checkhealth for more info
  • Operating system/version: macOS 10.14.5

Describe the bug
If you perform searching (maybe short words) quickly, sometimes it does redo.

To Reproduce using nvim -u mini.vim

Example:
cat mini.vim

" use your plugin manager, here is `vim-plug`
call plug#begin('~/.config/nvim/plugged')
Plug 'kevinhwang91/nvim-hlslens'

call plug#end()
lua require('hlslens').setup()
noremap <silent> n <Cmd>execute('normal! ' . v:count1 . 'n')<CR>
            \<Cmd>lua require('hlslens').start()<CR>
noremap <silent> N <Cmd>execute('normal! ' . v:count1 . 'N')<CR>
            \<Cmd>lua require('hlslens').start()<CR>
noremap * *<Cmd>lua require('hlslens').start()<CR>
noremap # #<Cmd>lua require('hlslens').start()<CR>
noremap g* g*<Cmd>lua require('hlslens').start()<CR>
noremap g# g#<Cmd>lua require('hlslens').start()<CR>

" use : instead of <Cmd>
nnoremap <silent> <leader>l :nohlsearch<CR>

Steps to reproduce the behavior:

  1. Launch nvim using nvim -u mini.vim
  2. Open some file and edit.
  3. Undo, so that redoing is possible.
  4. Search short words quickly.

Expected behavior
It should just perform search without modifying the content of the buffer.

Screenshots
This is what I reproduced using nvim -u mini.vim:
hlslens2

In this gif, I reproduced by searching th only, but from my experience, other search terms also caused the bug.

Hlslens causes `E5500: autocmd has thrown an exception` when trying to run command in visual mode

  • nvim --version: v0.8.0-dev-1152-g14610332b
  • Operating system/version: Ubuntu 20.04.4 LTS x86_64

Describe the bug
Whenever I tried doing commands on visually selected lines with hlslens installed (by packer) I got this:

:'<,'>n
E5500: autocmd has thrown an exception: Vim(lua):E16: Invalid range
:'<,'>no
E5500: autocmd has thrown an exception: Vim(lua):E481: No range allowed
:'<,'>nor
E5500: autocmd has thrown an exception: Vim(lua):E481: No range allowed
:'<,'>norm A')

Steps to reproduce the behavior:

  1. Open any files
  2. Do VISUAL LINE (V) on some lines
  3. Try to do norm command on visually selected lines: :'<,'>norm A')

Expected behavior
It should works

Screenshots

Screenshot_20220925_111506

Additional context
I tried uninstalling all my plugins to troubleshoot this, and what cause this issue is hlslens. Other than that, it's awesome plugins btw. Thanks.

Link HlSearchNear to CurSearch instead

This better matches the way search works without the plugin. For some themes they're the same, for others not (e.g. Catppuccin)
Could also potentially link the virtual text too to match.

Custom config does not work

Hi, I don't know why but my custom config for plugin stop working after update.
Thant's what I have:

local config = {
  calm_down = true,
  override_lens = function(render, plist, nearest, idx, r_idx)
    local sfw = vim.v.searchforward == 1
    local indicator, text, chunks
    local abs_r_idx = math.abs(r_idx)
    if abs_r_idx > 1 then
      indicator = string.format('%d%s', abs_r_idx, sfw ~= (r_idx > 1) and '' or '')
    elseif abs_r_idx == 1 then
      indicator = sfw ~= (r_idx == 1) and '' or ''
    else
      indicator = ''
    end

    local lnum, col = unpack(plist[idx])
    if nearest then
      local cnt = #plist
      if indicator ~= '' then
        text = string.format('[%s %d/%d]', indicator, idx, cnt)
      else
        text = string.format('[%d/%d]', idx, cnt)
      end
      chunks = {{' ', 'Ignore'}, {text, 'HlSearchLensNear'}}
    else
      text = string.format('[%s %d]', indicator, idx)
      chunks = {{' ', 'Ignore'}, {text, 'HlSearchLens'}}
    end
    render.set_virt(0, lnum - 1, col - 1, chunks, nearest)
  end
}

require('hlslens').setup(config)

Allow aligning lens text to side of window

Is your feature request related to a problem? Please describe.
Mostly I just want alignment to make it easier to scan for matches (faster to visually search an edge of a window than the entire text, even with colored highlighting). However, this would also help with lines that are longer than the window width.

Describe the solution you'd like
Align the lens text to be aligned to the side of the window, instead of at the end of the line.

I haven't read into neovim's virtual text feature, but I imagine this should be feasible.

Describe alternatives you've considered
Not sure. It might be possible to implement though setVirt but I haven't looked through the code yet. I imagined this was a straight forward enough feature that it makes sense to include it in the plugin. Plus I would rather avoid depending on a non-stable interface if possible.

Additional context
n/a

Matches all empty strings when using `:let @/ = ""` to clear the search pattern.

  • nvim --version: v0.6.1
  • Operating system/version: Linux arch 5.16.2-arch1-1

Describe the bug
Clearing the search pattern "the intended way" (not with the hlsearch option, because it disables highlighting) makes hlslens match all empty string in the document.

https://stackoverflow.com/a/657484
As stated in the above Stack verflow answer, and unless nvim does anything different, :let @/ = "" clears the search pattern and does not set it to "empty string". However hlslens does interpret it as empty stirng and matches all empty strings of the document, which is inconvenient.

http://vimdoc.sourceforge.net/htmldoc/pattern.html#last-pattern

To Reproduce using nvim -u mini.lua

Example:
cat mini.lua

-- packer
use {'kevinhwang91/nvim-hlslens'}

Steps to reproduce the behavior:

  1. /anything
  2. :let @/ = ""
  3. Enjoy?

Expected behavior
hsllens should not match anything.

Screenshots

Screenshot

Search History Breaks with nvim nightly and incsearch

Using a recent nvim nightly, if I start a search and type <up> I can't iterate through the search history anymore, it just gets stuck and the up and down arrows stop working. Disabling incsearch fixes things. This only started after a recent upgrade of nvim.

Question: setup

I'm trying to change some of the default settings, however, I noticed that they aren't taking effect. There's the hslens.vim file which calls the setup and setup toggles the initialized variable, so any subsequent call to setup() returns early. So I'm a bit confused by how any non-default settings are actually picked up.

Continue hlslens after :nohlsearch

When I search for a pattern, hlslens is working and showing the hints. If I stop the highlighting with :nohlsearch, hlslens disappears.

But then, the search can be invoked again e.g. by pressing n and in this case, hlslens hints are no longer showing.

Would it be possible to update the minimal configuration to also take this into account?

Thanks!

Customize virtual text readme setup not compatible with Lua5.2 or greater.

  • nvim --version: 0.8-dev
  • Operating system/version: Ubuntu 22.04(WSL)
  • Lua version: 5.4

Describe the bug
unpack() is deprecated since Lus5.2.

To Reproduce using nvim -u mini.lua

Example:
cat mini.lua

-- packer
use {'kevinhwang91/nvim-hlslens'}

require('hlslens').setup({
    override_lens = function(render, posList, nearest, idx, relIdx)
        local sfw = vim.v.searchforward == 1
        local indicator, text, chunks
        local absRelIdx = math.abs(relIdx)
        if absRelIdx > 1 then
            indicator = ('%d%s'):format(absRelIdx, sfw ~= (relIdx > 1) and '' or '')
        elseif absRelIdx == 1 then
            indicator = sfw ~= (relIdx == 1) and '' or ''
        else
            indicator = ''
        end

        local lnum, col = unpack(posList[idx])
        if nearest then
            local cnt = #posList
            if indicator ~= '' then
                text = ('[%s %d/%d]'):format(indicator, idx, cnt)
            else
                text = ('[%d/%d]'):format(idx, cnt)
            end
            chunks = {{' ', 'Ignore'}, {text, 'HlSearchLensNear'}}
        else
            text = ('[%s %d]'):format(indicator, idx)
            chunks = {{' ', 'Ignore'}, {text, 'HlSearchLens'}}
        end
        render.setVirt(0, lnum - 1, col - 1, chunks, nearest)
    end
})

Steps to reproduce the behavior:

  1. Install Lua greater than v5.2.
  2. Use the default setup for virtual text in README.md.
  3. Search something.

Expected behavior
Setup work with Lua5.2 and greater.

Additional context
I had tried using table.unpack() instead, but somehow nvim doesn't recognize this fucntion.

Send hlslens selection to a quickfix window

Is your feature request related to a problem? Please describe.
No, I did a quick search through the issues and readme but didn't see anything.

Describe the solution you'd like
Send the hlslens selection to a quickfix window. I still have a ton to learn about nvim so its most likely that I missed something.

Describe alternatives you've considered
I can do a telescope grep of the local file or folder to send to a quickfix window. I do tend to use hlslens more than telescope to search inside a file.

Additional context
Combined with bqf, hlslens is made even more powerful.

Thank you for reading my suggestion.

* search forward support

Is your feature request related to a problem? Please describe.
I use <Shift-8> (i.e. * forward search) and <Shift-3> (backward search) for the word under the cursor, and I realised this plugin doesn't support that.

Describe the solution you'd like
The ability to press * and have the current word under my cursor become the search term so I don't have to type out the word manually.

hlslens missing if first match is on first line of a buffer

  • nvim --version:v0.6.0-dev+182-ga373ca1d8
  • Operating system/version: macOS, centOS 7

Describe the bug

When using hlslens and search term is on the first line of buffer, hlslens will be missing for it.

To Reproduce using nvim -u mini.vim

Example:
cat mini.vim

set runtimepath+=/Users/jdhao/.local/share/nvim/site/pack/packer/start/nvim-hlslens

noremap <silent> n <Cmd>execute('normal! ' . v:count1 . 'nzzzv')<CR>
            \<Cmd>lua require('hlslens').start()<CR>
noremap <silent> N <Cmd>execute('normal! ' . v:count1 . 'Nzzzv')<CR>
            \<Cmd>lua require('hlslens').start()<CR>

map *  <Plug>(asterisk-z*)<Cmd>lua require('hlslens').start()<CR>
map #  <Plug>(asterisk-z#)<Cmd>lua require('hlslens').start()<CR>

Steps to reproduce the behavior:

  1. open nvim: nvim -u mini.vim
  2. Open a file with the following text:
test
test
test
test
  1. Move cursor to last line and press *, then press n.

notice that the hlslens is missing for the first match.

hlslens_bug

Invalid key 'noautocmd'

  • nvim --version:v0.5.0-dev
  • Operating system/version:manjaro

Describe the bug
Error executing vim.schedule lua callback: ...vim/plugged/nvim-hlslens/lua/hlslens/render/floatwin.lua:31: Invalid key 'noautocmd'

非准确描述
首先,非常抱歉,我可能没有办法先弄最小配置,然后提出哪里出了问题。我只能简单描述一下什么情况报错:
当 在长文件搜索,就会有上述报错。

other
非常感谢这个插件

translate from Google:

** Non-accurate description **

First of all, I am very sorry, I may have no way to get the smallest configuration first, and then I have made a problem. I can only describe what circumstances:

When searching in long files, there will be the above error.

** Other **

Thank you very much this plugin.

[Cross-Plugins] Conflict of NeoClear.lua

  • nvim --version: NVIM v0.9.0-dev-436+ga0dd663c2
  • Operating system/version: macOS 13.1

Describe the bug
I want to use your plugin with my own one https://github.com/nyngwang/NeoClear.lua. If I run :NeoClear and then type n(or N) again to jump to the next(or previous) word, the counter of occurrence will disappear. While I did find a workaround(code provided below), I'm thinking about how to get rid of the workaround code by fixing it upstream.

To Reproduce using nvim -u mini.lua

use {
  'petertriho/nvim-scrollbar', -- This plugin requires your plugin.
  requires = {
    'kevinhwang91/nvim-hlslens',
    config = function ()
      vim.keymap.set('n', 'n', function ()
        vim.cmd([[
          silent! normal! n
          lua require('hlslens').start()
        ]])
      end, NOREF_NOERR_TRUNC)
      vim.keymap.set('n', 'N', function ()
        vim.cmd([[
          silent! normal! N
          lua require('hlslens').start()
        ]])
      end, NOREF_NOERR_TRUNC)
    end
  },
  config = function ()
    require('scrollbar.handlers.search').setup()
    require('scrollbar').setup {}
  end
}

Steps to reproduce the behavior:

  1. Type /require or any other word that occurs many times in your current buffer.
  2. Type n. You will see the occurrence counter of hlslens
  3. Type :NeoClear.
  4. Do. 2. again. You will not see the occurrence counter this time.

Expected behavior
I can always see the occurrence counter whether I call :NeoClear or not.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Maybe this is related to my code: https://github.com/nyngwang/NeoClear.lua/blob/main/lua/neo-clear.lua#L10_L11

Virtual text displayed for current line only when `asterisk#keeppos` option is set

  • nvim --version:
    NVIM v0.6.1
    Build type: Release
    LuaJIT 2.0.5
    Compilé par builduser

Features: +acl +iconv +tui

Describe the bug

When nvim-hlslens is used with vim-asterisk as described in the Integrate with other plugins section of the README and the keepCursor feature of vim-asterisk is enabled with let g:asterisk#keeppos = 1, virtual texts of nvim-hlslens are:

  • all displayed if * is hit when the cursor is on the first character of a word
  • displayed only for the current line if * is hit when the cursor is not at the first character of a word

Steps to reproduce the behavior:

  1. move the cursor on the second character of a word
  2. hit *

Expected behavior

All virtual texts should be displayed.

Screenshots

  • Use case 1: result after hitting * when cursor is on the letter a of the first line

Screenshot_20220113_231021

  • Use case 2: result after hitting * when cursor is on the letter b of the first line

Screenshot_20220113_231049

Labels are not removed when using `vim.cmd('nohl')` but works when using `:nohl`

  • nvim --version: NVIM v0.8.0-dev-f98cff957-dirty
  • Operating system/version: macOS 10.15.7

Describe the bug

This is the expected behavior when using :nohl to clear matches

  1. search is started using * under word path
    image
  2. run command :nohl and results are cleared as expected
    image

and this is the bug when using vim.cmd('nohl') from lua

  1. search is started using * under word path
    image
  2. run command :lua vim.cmd('nohl')
    image
  3. when moving cursor to next/previous line all matches are removed

To Reproduce using nvim -u mini.lua

Example:
cat mini.lua

-- packer
use {'kevinhwang91/nvim-hlslens'}

local kopts = {noremap = true, silent = true}

vim.api.nvim_set_keymap('n', 'n',
    [[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]],
    kopts)
vim.api.nvim_set_keymap('n', 'N',
    [[<Cmd>execute('normal! ' . v:count1 . 'N')<CR><Cmd>lua require('hlslens').start()<CR>]],
    kopts)
vim.api.nvim_set_keymap('n', '*', [[*<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('n', '#', [[#<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('n', 'g*', [[g*<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('n', 'g#', [[g#<Cmd>lua require('hlslens').start()<CR>]], kopts)

vim.api.nvim_set_keymap('x', '*', [[*<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('x', '#', [[#<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('x', 'g*', [[g*<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('x', 'g#', [[g#<Cmd>lua require('hlslens').start()<CR>]], kopts)

vim.api.nvim_set_keymap('n', '<Leader>l', ':noh<CR>', kopts)

Steps to reproduce the behavior:

  1. start a match with *
  2. run :lua vim.cmd('nohl')
  3. check matches are still there on screen

Expected behavior
All matches are cleared

Screenshots
posted in the describe bug section

The foldopen option has no effect!

  • nvim --version: 0.8
  • Operating system/version: macOS 12.6

Describe the bug
:set fdo

foldopen=block,hor,mark,percent,quickfix,search,tag,undo

After searching a pattern, pressing n will not open the folding under cursor.

local kopts = {noremap = true, silent = true}

vim.api.nvim_set_keymap('n', 'n', [[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('n', 'N', [[<Cmd>execute('normal! ' . v:count1 . 'N')<CR><Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('n', '*', [[*<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('n', '#', [[#<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('n', 'g*', [[g*<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('n', 'g#', [[g#<Cmd>lua require('hlslens').start()<CR>]], kopts)

search count message not get updated after remap `n/N` key, if `lazyredraw` is on

  • nvim 0.7.0
  • macos

Describe the bug

Personally I'd like keep search count message at bottom-right, so in my vimrc I have set shortmess-=S. After enable hlslens, those count message do not get updated anymore after hit n/N, I found this is because map the n/N key with the example in README:

vim.api.nvim_set_keymap('n', 'n',
    [[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]],
    kopts)
vim.api.nvim_set_keymap('n', 'N',
    [[<Cmd>execute('normal! ' . v:count1 . 'N')<CR><Cmd>lua require('hlslens').start()<CR>]],
    kopts)

To Reproduce using nvim -u mini.lua

vim.cmd[[ set shortmess-=S ]]
-- packer
use {'kevinhwang91/nvim-hlslens'}

local kopts = {noremap = true, silent = true}

vim.api.nvim_set_keymap('n', 'n',
    [[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]],
    kopts)
vim.api.nvim_set_keymap('n', 'N',
    [[<Cmd>execute('normal! ' . v:count1 . 'N')<CR><Cmd>lua require('hlslens').start()<CR>]],
    kopts)
vim.api.nvim_set_keymap('n', '*', [[*<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('n', '#', [[#<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('n', 'g*', [[g*<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap('n', 'g#', [[g#<Cmd>lua require('hlslens').start()<CR>]], kopts)

Steps to reproduce the behavior:

  1. / search something
  2. hit n/N
  3. check if search count message get updated

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Incorrect(?) documentation for override_lens

the README, currently, describes override_lens as:

@param bufnr (number) buffer number
@param splist (table) (1,1)-indexed position
@param nearest (boolean) whether nearest lens
@param idx (number) nearest index in the plist
@param relIdx (number) relative index, negative means before current position, positive means after

Is the bufnr annotation correct? The override function seems to be passed the entire render object:

function M.addLens(bufnr, startPosList, nearest, idx, relIdx)
if type(config.override_lens) == 'function' then
-- export render module for hacking :)
return config.override_lens(M, startPosList, nearest, idx, relIdx)

Add nearest lens in nvim-ufo's preview floating window.

Using demo in README script is not perfect that is always using floating window to overlap status line. Invoking public API is not enough, need to hack code deeply.
nvim-ufo and nvim-hlslens are maintained by myself, I think I can make them work together perfectly.

Support Sexy_scroller.vim smooth scrolling.

Currently hlslens does not work with Sexy_scroller.vim, the best smooth scrolling plugin IMO I've tried so far.

Describe the solution you'd like
Just work with sexy_scroller likes with other smooth_scroll plugins.

Describe alternatives you've considered
It does work with other plugin like neoscroll though, so this could very well be due to the way sexy scroller is implemented.
From their README, I saw some notes about special handling of / command but I'm not very familiar with neovim internal to understand that.

calm_down - add additional option hide only hlsens labels

Is your feature request related to a problem? Please describe.
I sometimes use search highlights, so that I can easily visualize occurrences of selected/searched word. I do not use n/N then, so calm_down is great since it hides hlslens labels. But it also hides the highlights of matched words.

Describe the solution you'd like
add additional option - calm_down_labels_only to config. This with it enabled, only hlslens labels would be hidden.

Describe alternatives you've considered
I think there is none.

Additional context
image

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.