mirror of
https://github.com/nix-community/nixvim.git
synced 2025-11-08 19:46:06 +01:00
patterns: add module
A simple pattern viewer for Neovim with support for Lua patterns & regex.
This commit is contained in:
parent
e6958a9699
commit
0c867f9e63
2 changed files with 133 additions and 0 deletions
47
plugins/by-name/patterns/default.nix
Normal file
47
plugins/by-name/patterns/default.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{ lib, ... }:
|
||||
lib.nixvim.plugins.mkNeovimPlugin {
|
||||
name = "patterns";
|
||||
packPathName = "patterns.nvim";
|
||||
package = "patterns-nvim";
|
||||
|
||||
maintainers = [ lib.maintainers.khaneliman ];
|
||||
|
||||
settingsExample = {
|
||||
preferred_regex_matcher = "lua";
|
||||
update_delay = 300;
|
||||
|
||||
keymaps = {
|
||||
explain_input = {
|
||||
"<Esc>" = {
|
||||
callback = "close";
|
||||
};
|
||||
"K" = {
|
||||
callback = "lang_prev";
|
||||
};
|
||||
"J" = {
|
||||
callback = "lang_next";
|
||||
};
|
||||
};
|
||||
hover = {
|
||||
"e" = {
|
||||
callback = "edit";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
windows = {
|
||||
hover = lib.nixvim.nestedLiteralLua ''
|
||||
function(pos, side)
|
||||
return {
|
||||
width = math.floor(vim.o.columns * 0.8),
|
||||
height = math.floor(vim.o.lines * 0.6),
|
||||
border = "single",
|
||||
footer = {
|
||||
{ " Patterns ", "FloatTitle" },
|
||||
}
|
||||
}
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue