mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-10 09:14:31 +02:00
plugins/utils: move to by-name
This commit is contained in:
parent
faff32b9f1
commit
52f125679f
195 changed files with 2 additions and 102 deletions
|
@ -1,97 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
helpers,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
helpers.neovim-plugin.mkNeovimPlugin {
|
||||
name = "better-escape";
|
||||
originalName = "better-escape.nvim";
|
||||
luaName = "better_escape";
|
||||
package = "better-escape-nvim";
|
||||
|
||||
maintainers = [ maintainers.GaetanLepage ];
|
||||
|
||||
# TODO: introduced 2024-07-23. Remove after 24.11 release.
|
||||
deprecateExtraOptions = true;
|
||||
optionsRenamedToSettings = [ "timeout" ];
|
||||
imports =
|
||||
let
|
||||
basePluginPath = [
|
||||
"plugins"
|
||||
"better-escape"
|
||||
];
|
||||
in
|
||||
[
|
||||
(mkRemovedOptionModule (basePluginPath ++ [ "clearEmptyLines" ]) ''
|
||||
This option has been removed upstream.
|
||||
See the [upstream README](https://github.com/max397574/better-escape.nvim?tab=readme-ov-file#rewrite) for additional information.
|
||||
'')
|
||||
(mkRemovedOptionModule (basePluginPath ++ [ "keys" ]) ''
|
||||
This option has been removed upstream.
|
||||
See the [upstream README](https://github.com/max397574/better-escape.nvim?tab=readme-ov-file#rewrite) for additional information.
|
||||
'')
|
||||
(mkRemovedOptionModule (basePluginPath ++ [ "mapping" ]) ''
|
||||
This option has been removed in favor of `plugins.better-escape.settings.mapping`.
|
||||
See the [upstream README](https://github.com/max397574/better-escape.nvim?tab=readme-ov-file#rewrite) for additional information.
|
||||
'')
|
||||
];
|
||||
|
||||
settingsOptions = {
|
||||
timeout = helpers.defaultNullOpts.mkStrLuaOr types.ints.unsigned "vim.o.timeoutlen" ''
|
||||
The time in which the keys must be hit in ms.
|
||||
Uses the value of `vim.o.timeoutlen` (`options.timeoutlen` in nixvim) by default.
|
||||
'';
|
||||
|
||||
default_mappings = helpers.defaultNullOpts.mkBool true ''
|
||||
Whether to enable default key mappings.
|
||||
'';
|
||||
|
||||
mappings = helpers.defaultNullOpts.mkAttrsOf' {
|
||||
type = types.anything;
|
||||
pluginDefault = {
|
||||
i.j = {
|
||||
k = "<Esc>";
|
||||
j = "<Esc>";
|
||||
};
|
||||
c.j = {
|
||||
k = "<Esc>";
|
||||
j = "<Esc>";
|
||||
};
|
||||
t.j = {
|
||||
k = "<Esc>";
|
||||
j = "<Esc>";
|
||||
};
|
||||
v.j.k = "<Esc>";
|
||||
s.j.k = "<Esc>";
|
||||
};
|
||||
example.i." "."<tab>".__raw = ''
|
||||
function()
|
||||
-- Defer execution to avoid side-effects
|
||||
vim.defer_fn(function()
|
||||
-- set undo point
|
||||
vim.o.ul = vim.o.ul
|
||||
require("luasnip").expand_or_jump()
|
||||
end, 1)
|
||||
end
|
||||
'';
|
||||
description = "Define mappings for each mode.";
|
||||
};
|
||||
};
|
||||
|
||||
settingsExample = {
|
||||
timeout = "vim.o.timeoutlen";
|
||||
mapping = {
|
||||
i." "."<tab>".__raw = ''
|
||||
function()
|
||||
-- Defer execution to avoid side-effects
|
||||
vim.defer_fn(function()
|
||||
-- set undo point
|
||||
vim.o.ul = vim.o.ul
|
||||
require("luasnip").expand_or_jump()
|
||||
end, 1)
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue