-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflash.lua
More file actions
52 lines (52 loc) · 1.35 KB
/
flash.lua
File metadata and controls
52 lines (52 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
-- Example: flash.nvim integration with cmigemo.nvim
-- Add this to your lazy.nvim plugin specs.
return {
"folke/flash.nvim",
dependencies = { "LevNas/cmigemo.nvim", "atusy/budoux.lua" },
event = "VeryLazy",
---@type Flash.Config
opts = {
modes = {
char = { enabled = false },
search = { enabled = false },
},
},
config = function(_, opts)
require("flash").setup(opts)
local ok, cmigemo_flash = pcall(require, "cmigemo.ext.flash")
if ok then
cmigemo_flash.setup()
end
end,
keys = {
-- Migemo-enhanced jump: romaji input is converted to Japanese regex
{
"f",
function()
local ok, cmigemo_flash = pcall(require, "cmigemo.ext.flash")
if ok then
cmigemo_flash.jump()
else
require("flash").jump()
end
end,
mode = { "n", "x", "o" },
desc = "Flash: Migemo Jump",
},
-- Standard flash jump (no migemo)
{ "F", function() require("flash").jump() end,
mode = { "n", "x", "o" }, desc = "Flash: Jump" },
-- Bunsetsu (phrase) jump using BudouX segmenter
{
"gb",
function()
local ok, cmigemo_flash = pcall(require, "cmigemo.ext.flash")
if ok then
cmigemo_flash.bunsetsu()
end
end,
mode = { "n", "x", "o" },
desc = "Flash: Bunsetsu Jump (BudouX)",
},
},
}