marleyvim/nvim/lua/plugins/editor/flash-nvim.lua

61 lines
1.3 KiB
Lua

return {
'flash.nvim',
event = 'DeferredUIEnter',
keys = {
{
's',
function()
require('flash').jump()
end,
mode = { 'n', 'x', 'o' },
desc = 'flash',
},
{
'S',
function()
require('flash').treesitter()
end,
mode = { 'n', 'x', 'o' },
desc = 'flash (treesitter)',
},
{
'r',
function()
require('flash').remote()
end,
mode = { 'o' },
desc = 'remote flash',
},
{
'R',
function()
require('flash').treesitter_search()
end,
mode = { 'x', 'o' },
desc = 'treesitter search',
},
{
'<C-s>',
function()
require('flash').toggle()
end,
mode = { 'c' },
desc = 'toggle flash search',
},
},
before = function()
require('lz.n').trigger_load('which-key.nvim')
end,
after = function()
require('flash').setup({})
local mkKey = MarleyVim.wkSpec(require('colors').search)
require('which-key').add({
mkKey('s', nil, '', { mode = { 'n', 'x', 'o' } }),
mkKey('S', nil, '', { mode = { 'n', 'x', 'o' } }),
mkKey('r', nil, '', { mode = { 'o' } }),
mkKey('r', nil, '󰊕', { mode = { 'x', 'o' } }),
mkKey('<C-s>', nil, '󰥖', { mode = { 'c' } }),
})
end,
}