chrisgrieser / nvim-spider

Use the w, e, b motions like a spider. Move by subwords and skip insignificant punctuation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Add instructions for adding keymaps to lazy config

Anthony-Fiddes opened this issue · comments

Feature Requested

Since the default is for this plugin to be lazy loaded, maybe a section could be added explaining how to load the plugin when one of the motions is pressed? (I may be missing something super simple)

I found that my lazy config for the plugin looks like this:

    {
      "chrisgrieser/nvim-spider",
      keys = { "w", "e", "b", "ge" },
      config = function()
        vim.keymap.set({ "n", "o", "x" }, "w", "<cmd>lua require('spider').motion('w')<CR>", { desc = "Spider-w" })
        vim.keymap.set({ "n", "o", "x" }, "e", "<cmd>lua require('spider').motion('e')<CR>", { desc = "Spider-e" })
        vim.keymap.set({ "n", "o", "x" }, "b", "<cmd>lua require('spider').motion('b')<CR>", { desc = "Spider-b" })
        vim.keymap.set({ "n", "o", "x" }, "ge", "<cmd>lua require('spider').motion('ge')<CR>", { desc = "Spider-ge" })
      end,
      lazy = true,
    },

If I don't add the keymaps or set lazy=false, then the subword motions don't work.

Relevant Screenshot

No response

Checklist

  • The feature would be useful to more users than just me.

can be easier done via keys. See the updated README

The change is awesome, thanks!