diff --git a/README.md b/README.md index d03a3c7..65933dc 100644 --- a/README.md +++ b/README.md @@ -71,13 +71,14 @@ use { "chrisgrieser/nvim-spider" } ``` No keybindings are created by default. Below are the mappings to replace the default `w`, `e`, and `b` motions with this plugin's version of them. +Note that for dot-repeat to work properly, you have to use a `` mapping that calls the plugin function, **not** a lua function calling it! ```lua -- Keymaps -vim.keymap.set({"n", "o", "x"}, "w", function() require("spider").motion("w") end, { desc = "Spider-w" }) -vim.keymap.set({"n", "o", "x"}, "e", function() require("spider").motion("e") end, { desc = "Spider-e" }) -vim.keymap.set({"n", "o", "x"}, "b", function() require("spider").motion("b") end, { desc = "Spider-b" }) -vim.keymap.set({"n", "o", "x"}, "ge", function() require("spider").motion("ge") end, { desc = "Spider-ge" }) +vim.keymap.set({"n", "o", "x"}, "w", "lua require('spider').motion('w')", { desc = "Spider-w" }) +vim.keymap.set({"n", "o", "x"}, "e", "lua require('spider').motion('e')", { desc = "Spider-w" }) +vim.keymap.set({"n", "o", "x"}, "b", "lua require('spider').motion('b')", { desc = "Spider-w" }) +vim.keymap.set({"n", "o", "x"}, "ge", "lua require('spider').motion('ge')", { desc = "Spider-w" }) ``` ## Configuration @@ -91,9 +92,6 @@ require("spider").setup({ }) ``` -## Limitations -- [ ] Dot repeats when motion has been used as text object. ([Dot-repeat *for text objects* seems a bit more tricky, help is welcome.](https://github.com/chrisgrieser/nvim-various-textobjs/issues/7#issuecomment-1374861900)) - ## Credits __About Me__