Skip to content

Commit

Permalink
keymaps: use 'action.__raw' instead of 'lua = true' internally
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage committed Feb 3, 2024
1 parent 26a7c7e commit 2294a12
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 21 deletions.
3 changes: 1 addition & 2 deletions modules/keymaps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ with lib; {
# Mode can be a string or a list of strings
mode = "n";
key = "<leader>p";
action = "require('my-plugin').do_stuff";
lua = true;
action.__raw = "require('my-plugin').do_stuff";
# Note that all of the mapping options are now under the `options` attrs
options = {
silent = true;
Expand Down
3 changes: 1 addition & 2 deletions plugins/lsp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ in {
in {
mode = "n";
inherit key;
action = prefix + actionStr;
lua = true;
action.__raw = prefix + actionStr;

options =
{
Expand Down
6 changes: 2 additions & 4 deletions plugins/lsp/wtf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ with lib; let
ai = {
key = "gw";
mode = ["n" "x"];
action = "require('wtf').ai";
lua = true;
action.__raw = "require('wtf').ai";
};

search = {
key = "gW";
mode = "n";
action = "require('wtf').search";
lua = true;
action.__raw = "require('wtf').search";
};
};
in {
Expand Down
3 changes: 1 addition & 2 deletions plugins/telescope/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ in {
in {
mode = "n";
inherit key;
action = "require('telescope.builtin').${actionStr}";
lua = true;
action.__raw = "require('telescope.builtin').${actionStr}";

options =
{
Expand Down
5 changes: 2 additions & 3 deletions plugins/utils/harpoon.nix
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ in {
(key != null)
{
inherit key;
action = luaFunc;
action.__raw = luaFunc;
}
)
{
Expand All @@ -256,7 +256,7 @@ in {
mapAttrsToList
(id: key: {
inherit key;
action = genLuaFunc id;
action.__raw = genLuaFunc id;
})
mappingsAttrs
)
Expand All @@ -283,7 +283,6 @@ in {
helpers.keymaps.mkKeymaps
{
mode = "n";
lua = true;
options.silent = cfg.keymapsSilent;
}
allMappings;
Expand Down
3 changes: 1 addition & 2 deletions plugins/utils/intellitab.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ in {
{
mode = "i";
key = "<Tab>";
action = "require('intellitab').indent";
lua = true;
action.__raw = "require('intellitab').indent";
}
];
plugins.treesitter = {
Expand Down
6 changes: 2 additions & 4 deletions plugins/utils/nvim-osc52.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ with lib; {
{
mode = "n";
key = copy;
action = "require('osc52').copy_operator";
lua = true;
action.__raw = "require('osc52').copy_operator";
options = {
expr = true;
inherit silent;
Expand All @@ -80,8 +79,7 @@ with lib; {
{
mode = "v";
key = copyVisual;
action = "require('osc52').copy_visual";
lua = true;
action.__raw = "require('osc52').copy_visual";
options.silent = silent;
}
];
Expand Down
3 changes: 1 addition & 2 deletions plugins/utils/spider.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ in {
motion: key: {
mode = ["n" "o" "x"];
inherit key;
action = "function() require('spider').motion('${motion}') end";
lua = true;
action.__raw = "function() require('spider').motion('${motion}') end";
options = {
inherit (cfg.keymaps) silent;
desc = "Spider-${motion}";
Expand Down

0 comments on commit 2294a12

Please sign in to comment.