folke / flash.nvim

Navigate your code with search labels, enhanced character motions and Treesitter integration
Apache License 2.0
2.57k stars 34 forks source link

feature: easymotion-sn like experience. able to replace '/' #250

Closed PEMessage closed 1 year ago

PEMessage commented 1 year ago

Did you check the docs?

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

Unfortunate, It's seem like only easymotion implement this.

Describe the solution you'd like

Easymotion-sn able to replace default \. you could just type, and <tab> to surfing around. if you find what you want, you don't need to conside tag, just type <space> or <enter> to go first match. It‘s very useful when you are viewing the code rather then edit it. you don't need exact tag to jump.

The key is <tab> to surfing and <enter>/<space> to jump first

Highly recommend try the plug-in(easymotion) setting below.

Compare to telescope. you don't need leave cur window, which might break your thought. And also give you more info, like the density of matches. and whole screen context of matches.

Compare to default '/'. If you find that what you type is not what you need, just . no need to enter </> , to find more. And type tab to surf is much faster! It's surfing by screen.

Here is a quickview gif: WindowsTerminal_gyvkStKiET

Describe alternatives you've considered

easymotion itself

Additional context

the easymotion config i'm using, using lazy.nvim

{
    'easymotion/vim-easymotion',
    event = 'VeryLazy',
    init = function()
        vim.g.EasyMotion_smartcase        = 1
        vim.g.EasyMotion_do_mapping       = 0
        vim.g.EasyMotion_enter_jump_first = 1
        vim.g.EasyMotion_space_jump_first = 1
        vim.g.EasyMotion_use_upper        = 1
        vim.keymap.set(
            'n',
            '/','<Plug>(easymotion-sn)',
            { remap = true }
        )
    end,
}
IndianBoy42 commented 1 year ago

Do you know about C-g, C-t to navigate matches without leaving the search prompt? Its builtin to neovim

folke commented 1 year ago

true, and you can of course add cmdline mappings if you want to use different keys