mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-09 22:55:58 +01:00
Compare commits
4 commits
275f78f683
...
269d574720
Author | SHA1 | Date | |
---|---|---|---|
|
269d574720 | ||
|
c7df5c97f3 | ||
|
e086dc02fe | ||
|
fc58c85524 |
2 changed files with 42 additions and 9 deletions
|
@ -71,6 +71,24 @@
|
||||||
mkLznBinding = mode: lhs: rhs: desc: {
|
mkLznBinding = mode: lhs: rhs: desc: {
|
||||||
inherit mode lhs rhs desc;
|
inherit mode lhs rhs desc;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Usage:
|
||||||
|
#
|
||||||
|
# ```
|
||||||
|
# vim.lazy.plugins = {
|
||||||
|
# telescope = {
|
||||||
|
# # ...
|
||||||
|
# keys = builtins.filter ({lhs, ...}: lhs != null) [
|
||||||
|
# mkSetLznBinding mapping ":Telescope<CR>"
|
||||||
|
# ];
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
# ```
|
||||||
|
mkSetLznBinding = binding: action: {
|
||||||
|
lhs = binding.value;
|
||||||
|
rhs = action;
|
||||||
|
desc = binding.description;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
binds
|
binds
|
||||||
|
|
|
@ -31,7 +31,21 @@
|
||||||
(removeAttrs spec ["package" "setupModule" "setupOpts" "keys"])
|
(removeAttrs spec ["package" "setupModule" "setupOpts" "keys"])
|
||||||
// {
|
// {
|
||||||
"@1" = name;
|
"@1" = name;
|
||||||
after = mkLuaInline ''
|
before =
|
||||||
|
if spec.before != null
|
||||||
|
then
|
||||||
|
mkLuaInline ''
|
||||||
|
function()
|
||||||
|
${spec.before}
|
||||||
|
end
|
||||||
|
''
|
||||||
|
else null;
|
||||||
|
|
||||||
|
after =
|
||||||
|
if spec.setupModule == null && spec.after == null
|
||||||
|
then null
|
||||||
|
else
|
||||||
|
mkLuaInline ''
|
||||||
function()
|
function()
|
||||||
${
|
${
|
||||||
optionalString (spec.setupModule != null)
|
optionalString (spec.setupModule != null)
|
||||||
|
@ -40,6 +54,7 @@
|
||||||
${optionalString (spec.after != null) spec.after}
|
${optionalString (spec.after != null) spec.after}
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
|
|
||||||
keys =
|
keys =
|
||||||
if typeOf spec.keys == "list" && length spec.keys > 0 && typeOf (head spec.keys) == "set"
|
if typeOf spec.keys == "list" && length spec.keys > 0 && typeOf (head spec.keys) == "set"
|
||||||
then map toLuzLznKeySpec spec.keys
|
then map toLuzLznKeySpec spec.keys
|
||||||
|
|
Loading…
Reference in a new issue