From fffb401cff56c69cb7a9a48daf58d8f3c45cbd8b Mon Sep 17 00:00:00 2001 From: TheSast <27977196+TheSast@users.noreply.github.com> Date: Mon, 22 May 2023 11:33:13 +0200 Subject: [PATCH] feat(motion): Add nvim-spider --- .../motion/nvim-spider/README.md | 27 +++++++++++++++++++ .../motion/nvim-spider/nvim-spider.lua | 10 +++++++ 2 files changed, 37 insertions(+) create mode 100644 lua/astrocommunity/motion/nvim-spider/README.md create mode 100644 lua/astrocommunity/motion/nvim-spider/nvim-spider.lua diff --git a/lua/astrocommunity/motion/nvim-spider/README.md b/lua/astrocommunity/motion/nvim-spider/README.md new file mode 100644 index 000000000..57c326007 --- /dev/null +++ b/lua/astrocommunity/motion/nvim-spider/README.md @@ -0,0 +1,27 @@ +# nvim-spider +**Repository:** https://github.com/chrisgrieser/nvim-spider + +Use the `w`, `e`, `b` motions like a spider. + +# Features +## Subword Motion + + ```lua + -- positions vim's `w` will move to + local myVariableName = FOO_BAR_BAZ + -- ^ ^ ^ + + -- positions spider's `w` will move to + local myVariableName = FOO_BAR_BAZ + -- ^ ^ ^ ^ ^ ^ ^ + ``` + +## Skipping Insignificant Punctuation + + ```lua + foo == bar .. "baz" + -- ^ ^ significant punctuation + + foo:find("a") + -- ^ ^ ^ insignificant punctuation + ``` diff --git a/lua/astrocommunity/motion/nvim-spider/nvim-spider.lua b/lua/astrocommunity/motion/nvim-spider/nvim-spider.lua new file mode 100644 index 000000000..49bd8d708 --- /dev/null +++ b/lua/astrocommunity/motion/nvim-spider/nvim-spider.lua @@ -0,0 +1,10 @@ +return { + "chrisgrieser/nvim-spider", + keys = { + { "w", "lua require('spider').motion('w')", mode = { "n", "x", "o" } }, + { "e", "lua require('spider').motion('e')", mode = { "n", "x", "o" } }, + { "b", "lua require('spider').motion('b')", mode = { "n", "x", "o" } }, + { "ge", "lua require('spider').motion('ge')", mode = { "n", "x", "o" } }, + }, + opts = {}, +}