mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
plugins/flash: switch to mkNeovimPlugin
This commit is contained in:
parent
7cc1685eaf
commit
aaab869d4f
2 changed files with 801 additions and 736 deletions
File diff suppressed because it is too large
Load diff
|
@ -8,205 +8,195 @@
|
||||||
plugins.flash = {
|
plugins.flash = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
labels = "asdfghjklqwertyuiopzxcvbnm";
|
settings = {
|
||||||
search = {
|
labels = "asdfghjklqwertyuiopzxcvbnm";
|
||||||
multiWindow = true;
|
search = {
|
||||||
forward = true;
|
multi_window = true;
|
||||||
wrap = true;
|
forward = true;
|
||||||
mode = "exact";
|
wrap = true;
|
||||||
incremental = false;
|
mode = "exact";
|
||||||
exclude = [
|
incremental = false;
|
||||||
"notify"
|
exclude = [
|
||||||
"cmp_menu"
|
"notify"
|
||||||
"noice"
|
"cmp_menu"
|
||||||
"flash_prompt"
|
"noice"
|
||||||
{
|
"flash_prompt"
|
||||||
__raw = ''
|
(helpers.mkRaw ''
|
||||||
function(win)
|
function(win)
|
||||||
-- exclude non-focusable windows
|
-- exclude non-focusable windows
|
||||||
return not vim.api.nvim_win_get_config(win).focusable
|
return not vim.api.nvim_win_get_config(win).focusable
|
||||||
end
|
end
|
||||||
'';
|
'')
|
||||||
}
|
|
||||||
];
|
|
||||||
trigger = "";
|
|
||||||
maxLength = false;
|
|
||||||
};
|
|
||||||
jump = {
|
|
||||||
jumplist = true;
|
|
||||||
pos = "start";
|
|
||||||
history = false;
|
|
||||||
register = false;
|
|
||||||
nohlsearch = false;
|
|
||||||
autojump = false;
|
|
||||||
inclusive = null;
|
|
||||||
offset = null;
|
|
||||||
};
|
|
||||||
label = {
|
|
||||||
uppercase = true;
|
|
||||||
exclude = "";
|
|
||||||
current = true;
|
|
||||||
after = true;
|
|
||||||
before = false;
|
|
||||||
style = "overlay";
|
|
||||||
reuse = "lowercase";
|
|
||||||
distance = true;
|
|
||||||
minPatternLength = 0;
|
|
||||||
rainbow = {
|
|
||||||
enabled = false;
|
|
||||||
shade = 5;
|
|
||||||
};
|
|
||||||
format = ''
|
|
||||||
function(opts)
|
|
||||||
return { { opts.match.label, opts.hl_group } }
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
highlight = {
|
|
||||||
backdrop = true;
|
|
||||||
matches = true;
|
|
||||||
priority = 5000;
|
|
||||||
groups = {
|
|
||||||
match = "FlashMatch";
|
|
||||||
current = "FlashCurrent";
|
|
||||||
backdrop = "FlashBackdrop";
|
|
||||||
label = "FlashLabel";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
action = null;
|
|
||||||
pattern = "";
|
|
||||||
continue = false;
|
|
||||||
config = null;
|
|
||||||
prompt = {
|
|
||||||
enabled = true;
|
|
||||||
prefix = [
|
|
||||||
[
|
|
||||||
"⚡"
|
|
||||||
"FlashPromptIcon"
|
|
||||||
]
|
|
||||||
];
|
|
||||||
winConfig = {
|
|
||||||
relative = "editor";
|
|
||||||
width = 1;
|
|
||||||
height = 1;
|
|
||||||
row = -1;
|
|
||||||
col = 0;
|
|
||||||
zindex = 1000;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
remoteOp = {
|
|
||||||
restore = false;
|
|
||||||
motion = false;
|
|
||||||
};
|
|
||||||
modes = {
|
|
||||||
search = {
|
|
||||||
enabled = true;
|
|
||||||
highlight = {
|
|
||||||
backdrop = false;
|
|
||||||
};
|
|
||||||
jump = {
|
|
||||||
history = true;
|
|
||||||
register = true;
|
|
||||||
nohlsearch = true;
|
|
||||||
};
|
|
||||||
search.automatic = true;
|
|
||||||
};
|
|
||||||
char = {
|
|
||||||
enabled = true;
|
|
||||||
config = ''
|
|
||||||
function(opts)
|
|
||||||
-- autohide flash when in operator-pending mode
|
|
||||||
opts.autohide = vim.fn.mode(true):find("no") and vim.v.operator == "y"
|
|
||||||
|
|
||||||
-- disable jump labels when not enabled, when using a count,
|
|
||||||
-- or when recording/executing registers
|
|
||||||
opts.jump_labels = opts.jump_labels
|
|
||||||
and vim.v.count == 0
|
|
||||||
and vim.fn.reg_executing() == ""
|
|
||||||
and vim.fn.reg_recording() == ""
|
|
||||||
|
|
||||||
-- Show jump labels only in operator-pending mode
|
|
||||||
-- opts.jump_labels = vim.v.count == 0 and vim.fn.mode(true):find("o")
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
autohide = false;
|
|
||||||
jumpLabels = false;
|
|
||||||
multiLine = true;
|
|
||||||
label = {
|
|
||||||
exclude = "hjkliardc";
|
|
||||||
};
|
|
||||||
keys = helpers.listToUnkeyedAttrs [
|
|
||||||
"f"
|
|
||||||
"F"
|
|
||||||
"t"
|
|
||||||
"T"
|
|
||||||
";"
|
|
||||||
","
|
|
||||||
];
|
];
|
||||||
charActions = ''
|
trigger = "";
|
||||||
function(motion)
|
max_length = false;
|
||||||
return {
|
};
|
||||||
[";"] = "next", -- set to `right` to always go right
|
jump = {
|
||||||
[","] = "prev", -- set to `left` to always go left
|
jumplist = true;
|
||||||
-- clever-f style
|
pos = "start";
|
||||||
[motion:lower()] = "next",
|
history = false;
|
||||||
[motion:upper()] = "prev",
|
register = false;
|
||||||
-- jump2d style: same case goes next, opposite case goes prev
|
nohlsearch = false;
|
||||||
-- [motion] = "next",
|
autojump = false;
|
||||||
-- [motion:match("%l") and motion:upper() or motion:lower()] = "prev",
|
inclusive = null;
|
||||||
}
|
offset = null;
|
||||||
|
};
|
||||||
|
label = {
|
||||||
|
uppercase = true;
|
||||||
|
exclude = "";
|
||||||
|
current = true;
|
||||||
|
after = true;
|
||||||
|
before = false;
|
||||||
|
style = "overlay";
|
||||||
|
reuse = "lowercase";
|
||||||
|
distance = true;
|
||||||
|
min_pattern_length = 0;
|
||||||
|
rainbow = {
|
||||||
|
enabled = false;
|
||||||
|
shade = 5;
|
||||||
|
};
|
||||||
|
format = ''
|
||||||
|
function(opts)
|
||||||
|
return { { opts.match.label, opts.hl_group } }
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
search = {
|
};
|
||||||
wrap = false;
|
highlight = {
|
||||||
};
|
backdrop = true;
|
||||||
highlight = {
|
matches = true;
|
||||||
backdrop = true;
|
priority = 5000;
|
||||||
};
|
groups = {
|
||||||
jump = {
|
match = "FlashMatch";
|
||||||
register = false;
|
current = "FlashCurrent";
|
||||||
|
backdrop = "FlashBackdrop";
|
||||||
|
label = "FlashLabel";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
treesitter = {
|
action = null;
|
||||||
labels = "abcdefghijklmnopqrstuvwxyz";
|
pattern = "";
|
||||||
jump = {
|
continue = false;
|
||||||
pos = "range";
|
config = null;
|
||||||
};
|
prompt = {
|
||||||
search = {
|
enabled = true;
|
||||||
incremental = false;
|
prefix = [
|
||||||
};
|
[
|
||||||
label = {
|
"⚡"
|
||||||
before = true;
|
"FlashPromptIcon"
|
||||||
after = true;
|
]
|
||||||
style = "inline";
|
];
|
||||||
};
|
win_config = {
|
||||||
highlight = {
|
relative = "editor";
|
||||||
backdrop = false;
|
width = 1;
|
||||||
matches = false;
|
height = 1;
|
||||||
|
row = -1;
|
||||||
|
col = 0;
|
||||||
|
zindex = 1000;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
treesitterSearch = {
|
remote_op = {
|
||||||
jump = {
|
restore = false;
|
||||||
pos = "range";
|
motion = false;
|
||||||
};
|
|
||||||
search = {
|
|
||||||
multiWindow = true;
|
|
||||||
wrap = true;
|
|
||||||
incremental = false;
|
|
||||||
};
|
|
||||||
remoteOp = {
|
|
||||||
restore = true;
|
|
||||||
};
|
|
||||||
label = {
|
|
||||||
before = true;
|
|
||||||
after = true;
|
|
||||||
style = "inline";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
remote = {
|
modes = {
|
||||||
remoteOp = {
|
search = {
|
||||||
restore = true;
|
enabled = false;
|
||||||
motion = true;
|
highlight = {
|
||||||
|
backdrop = false;
|
||||||
|
};
|
||||||
|
jump = {
|
||||||
|
history = true;
|
||||||
|
register = true;
|
||||||
|
nohlsearch = true;
|
||||||
|
};
|
||||||
|
search = {
|
||||||
|
forward.__raw = "vim.fn.getcmdtype() == '/'";
|
||||||
|
mode = "search";
|
||||||
|
incremental.__raw = "vim.go.incsearch";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
char = {
|
||||||
|
enabled = true;
|
||||||
|
config = ''
|
||||||
|
function(opts)
|
||||||
|
-- autohide flash when in operator-pending mode
|
||||||
|
opts.autohide = opts.autohide or (vim.fn.mode(true):find("no") and vim.v.operator == "y")
|
||||||
|
|
||||||
|
-- disable jump labels when not enabled, when using a count,
|
||||||
|
-- or when recording/executing registers
|
||||||
|
opts.jump_labels = opts.jump_labels
|
||||||
|
and vim.v.count == 0
|
||||||
|
and vim.fn.reg_executing() == ""
|
||||||
|
and vim.fn.reg_recording() == ""
|
||||||
|
|
||||||
|
-- Show jump labels only in operator-pending mode
|
||||||
|
-- opts.jump_labels = vim.v.count == 0 and vim.fn.mode(true):find("o")
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
autohide = false;
|
||||||
|
jump_labels = false;
|
||||||
|
multi_line = true;
|
||||||
|
label = {
|
||||||
|
exclude = "hjkliardc";
|
||||||
|
};
|
||||||
|
keys = {
|
||||||
|
__unkeyed-0 = "f";
|
||||||
|
__unkeyed-1 = "F";
|
||||||
|
__unkeyed-2 = "t";
|
||||||
|
__unkeyed-3 = "T";
|
||||||
|
__unkeyed-4 = ";";
|
||||||
|
__unkeyed-5 = ",";
|
||||||
|
};
|
||||||
|
char_actions = ''
|
||||||
|
function(motion)
|
||||||
|
return {
|
||||||
|
[";"] = "next", -- set to `right` to always go right
|
||||||
|
[","] = "prev", -- set to `left` to always go left
|
||||||
|
-- clever-f style
|
||||||
|
[motion:lower()] = "next",
|
||||||
|
[motion:upper()] = "prev",
|
||||||
|
-- jump2d style: same case goes next, opposite case goes prev
|
||||||
|
-- [motion] = "next",
|
||||||
|
-- [motion:match("%l") and motion:upper() or motion:lower()] = "prev",
|
||||||
|
}
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
search.wrap = false;
|
||||||
|
highlight.backdrop = true;
|
||||||
|
jump.register = false;
|
||||||
|
};
|
||||||
|
treesitter = {
|
||||||
|
labels = "abcdefghijklmnopqrstuvwxyz";
|
||||||
|
jump.pos = "range";
|
||||||
|
search.incremental = false;
|
||||||
|
label = {
|
||||||
|
before = true;
|
||||||
|
after = true;
|
||||||
|
style = "inline";
|
||||||
|
};
|
||||||
|
highlight = {
|
||||||
|
backdrop = false;
|
||||||
|
matches = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
treesitter_search = {
|
||||||
|
jump.pos = "range";
|
||||||
|
search = {
|
||||||
|
multi_window = true;
|
||||||
|
wrap = true;
|
||||||
|
incremental = false;
|
||||||
|
};
|
||||||
|
remote_op.restore = true;
|
||||||
|
label = {
|
||||||
|
before = true;
|
||||||
|
after = true;
|
||||||
|
style = "inline";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
remote = {
|
||||||
|
remote_op = {
|
||||||
|
restore = true;
|
||||||
|
motion = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue