diff --git a/modules/commands.nix b/modules/commands.nix index 5a37a481..dd508f64 100644 --- a/modules/commands.nix +++ b/modules/commands.nix @@ -54,7 +54,7 @@ in { extraConfigLua = helpers.wrapDo '' local cmds = ${helpers.toLuaObject (mapAttrs cleanupCommand config.userCommands)}; for name,cmd in pairs(cmds) do - vim.api.nvim_create_user_command(name, cmd.command, cmd.options) + vim.api.nvim_create_user_command(name, cmd.command, cmd.options or {}) end ''; }; diff --git a/tests/test-sources/modules/commands.nix b/tests/test-sources/modules/commands.nix index 96c5cf6e..f65a5016 100644 --- a/tests/test-sources/modules/commands.nix +++ b/tests/test-sources/modules/commands.nix @@ -5,6 +5,9 @@ command = ":w"; desc = "Write file"; }; + "Z" = { + command = ":echo fooo"; + }; }; }; }