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

62 lines
1.3 KiB
Lua
Raw Normal View History

2024-12-01 11:48:43 -08:00
return {
'flash.nvim',
event = 'DeferredUIEnter',
keys = {
{
's',
function()
require('flash').jump()
end,
mode = { 'n', 'x', 'o' },
2024-12-01 17:10:02 -08:00
desc = 'flash',
2024-12-01 11:48:43 -08:00
},
{
'S',
function()
require('flash').treesitter()
end,
mode = { 'n', 'x', 'o' },
2024-12-01 17:10:02 -08:00
desc = 'flash (treesitter)',
2024-12-01 11:48:43 -08:00
},
{
'r',
function()
require('flash').remote()
end,
2024-12-01 17:10:02 -08:00
mode = { 'o' },
desc = 'remote flash',
2024-12-01 11:48:43 -08:00
},
{
'R',
function()
require('flash').treesitter_search()
end,
mode = { 'x', 'o' },
2024-12-01 17:10:02 -08:00
desc = 'treesitter search',
2024-12-01 11:48:43 -08:00
},
{
'<C-s>',
function()
require('flash').toggle()
end,
2024-12-01 17:10:02 -08:00
mode = { 'c' },
desc = 'toggle flash search',
2024-12-01 11:48:43 -08:00
},
},
2024-12-01 17:10:02 -08:00
before = function()
require('lz.n').trigger_load('which-key.nvim')
end,
2024-12-01 11:48:43 -08:00
after = function()
require('flash').setup({})
2024-12-01 17:10:02 -08:00
local mkKey = MarleyVim.wkSpec(require('colors').search)
require('which-key').add({
2024-12-04 21:41:30 -08:00
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' } }),
2024-12-01 17:10:02 -08:00
})
2024-12-01 11:48:43 -08:00
end,
}