@@ -92,45 +92,25 @@ No keybindings are created by default. Below are the mappings to replace the
9292default ` w ` , ` e ` , and ` b ` motions with this plugin's version of them.
9393
9494``` lua
95- vim .keymap .set (
96- { " n" , " o" , " x" },
97- " w" ,
98- " <cmd>lua require('spider').motion('w')<CR>" ,
99- { desc = " Spider-w" }
100- )
101- vim .keymap .set (
102- { " n" , " o" , " x" },
103- " e" ,
104- " <cmd>lua require('spider').motion('e')<CR>" ,
105- { desc = " Spider-e" }
106- )
107- vim .keymap .set (
108- { " n" , " o" , " x" },
109- " b" ,
110- " <cmd>lua require('spider').motion('b')<CR>" ,
111- { desc = " Spider-b" }
112- )
113-
114- -- OR: lazy-load on keystroke
115- -- lazy.nvim
95+ vim .keymap .set ({ " n" , " o" , " x" }, " w" , " <cmd>lua require('spider').motion('w')<CR>" )
96+ vim .keymap .set ({ " n" , " o" , " x" }, " e" , " <cmd>lua require('spider').motion('e')<CR>" )
97+ vim .keymap .set ({ " n" , " o" , " x" }, " b" , " <cmd>lua require('spider').motion('b')<CR>" )
98+
99+ -- OR: lazy-load on keystroke (lazy.nvim)
116100{
117101 " chrisgrieser/nvim-spider" ,
118102 keys = {
119- {
120- " e" ,
121- " <cmd>lua require('spider').motion('e')<CR>" ,
122- mode = { " n" , " o" , " x" },
123- },
124- -- ...
103+ { " w" , " <cmd>lua require('spider').motion('w')<CR>" , mode = { " n" , " o" , " x" } },
104+ { " e" , " <cmd>lua require('spider').motion('e')<CR>" , mode = { " n" , " o" , " x" } },
105+ { " b" , " <cmd>lua require('spider').motion('b')<CR>" , mode = { " n" , " o" , " x" } },
125106 },
126107},
127108```
128109
129- <!-- vale Google.Will = NO -->
130110> [ !NOTE]
131111> For dot-repeat to work, you have to call the motions as Ex-commands.
132112> Dot-repeat will not work when using `function() require("spider").motion("w")
133- > end` as third argument,
113+ > end` as third argument.
134114
135115## Configuration
136116
@@ -188,9 +168,7 @@ require("spider").motion("w", {
188168-- setting `overrideDefault` to false.
189169require (" spider" ).motion (" w" , {
190170 customPatterns = {
191- patterns = {
192- (" %x" ):rep (6 ) .. " +" },
193- },
171+ patterns = { (" %x" ):rep (6 ) .. " +" } },
194172 overrideDefault = false ,
195173 },
196174})
@@ -244,20 +222,20 @@ camelCase, check out the `subword` text object of
244222### Operator-pending mode: the case of ` cw `
245223In operator pending mode, vim's ` web ` motions are actually a bit inconsistent.
246224For instance, ` cw ` will change to the * end* of a word instead of the start of
247- the next word, like ` dw ` does. This is probably done for convenience in vi 's
225+ the next word, like ` dw ` does. This is probably done for convenience in ` vi ` 's
248226early days before there were text objects. In my view, this is quite problematic
249227since it makes people habitualize inconsistent motion behavior.
250228
251229In this plugin, such small inconsistencies are therefore deliberately not
252230implemented. Apart from the inconsistency, such a behavior can create unexpected
253- results when used in subwords or near punctuation. If you nevertheless want to,
254- you can achieve that behavior by mapping ` cw ` to ` ce ` :
231+ results when used in subwords or near punctuation. If you nevertheless prefer
232+ that behavior, you can achieve that behavior by mapping ` cw ` to ` ce ` :
255233
256234``` lua
257235vim .keymap .set (" o" , " w" , " <cmd>lua require('spider').motion('w')<CR>" )
258236vim .keymap .set (" n" , " cw" , " ce" , { remap = true })
259237
260- -- or the same in one mapping without `remap = true`
238+ -- OR in one mapping
261239vim .keymap .set (" n" , " cw" , " c<cmd>lua require('spider').motion('e')<CR>" )
262240```
263241
@@ -295,7 +273,7 @@ would be yanked charwise.
295273** Caveats**
2962741 . Last visual selection marks (`` `[ `` and `` `] `` ) are updated
297275 and point to the endpoints of the motion. This was not always the case before.
298- 2 . Forced blockwise motion may be cancelled if it cannot be correctly
276+ 2 . Forced blockwise motion may be canceled if it cannot be correctly
299277 represented with the current ` selection ` option.
300278
301279### Motions in insert mode
@@ -308,12 +286,12 @@ vim.keymap.set("i", "<C-b>", "<Esc><cmd>lua require('spider').motion('b')<CR>i")
308286```
309287
310288## Credits
311- ** Thanks**
289+ ** Thanks**
312290- ` @vypxl ` and ` @ii14 ` [ for figuring out dot-repeatability of
313291 textobjects] ( https://github.com/chrisgrieser/nvim-spider/pull/4 ) .
314292- ` @vanaigr ` for a large contribution regarding operator-pending mode.
315293
316- ** About the developer**
294+ ** About the developer**
317295In my day job, I am a sociologist studying the social mechanisms underlying the
318296digital economy. For my PhD project, I investigate the governance of the app
319297economy and how software ecosystems manage the tension between innovation and
0 commit comments