Skip to content

Commit

Permalink
chore: auto generate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gbprod authored and actions-user committed Feb 15, 2022
1 parent bf12288 commit 3ffc5cf
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions doc/substitute-nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,24 @@ EXCHANGE OPERATOR *substitute-nvim-exchange-operator*
This operator allows to quickly exchange text inside a buffer.

Eg. To exchange two words, place your cursor on the first word and type `sxiw`.
Then move to the second word and type `sxiw` again. Note: the {motion} used in
the first and second use of `sx` don’t have to be the same. Note 2: this is
dot-repeatable, so you can use `.` instead of `sxiw` for the second word.
Then move to the second word and type `sxiw` again.

Note: the {motion} used in the first and second use of `sx` don’t have to be
the same. Note 2: this is dot-repeatable, so you can use `.` instead of `sxiw`
for the second word.

You can select a whole line using the `line` function (`sxx` in the example
below).

Because this operator has to be invoked twice to change the document, if you
change your mind after invoking the operator once, you can cancel you selection
using the `cancel` function (mapped to `sxc` in the example below).

>
vim.api.nvim_set_keymap("n", "sx", "<cmd>lua require('substitute.exchange').operator()<cr>", { noremap = true })
vim.api.nvim_set_keymap("n", "sxx", "<cmd>lua require('substitute.exchange').line()<cr>", { noremap = true })
vim.api.nvim_set_keymap("x", "X", "<cmd>lua require('substitute.exchange').visual()<cr>")
vim.api.nvim_set_keymap("x", "X", "<cmd>lua require('substitute.exchange').visual()<cr>", { noremap = true })
vim.api.nvim_set_keymap("n", "sxc", "<cmd>lua require('substitute.exchange').cancel()<cr>", { noremap = true })
<


Expand All @@ -290,6 +300,7 @@ or
nmap sx <cmd>lua require('substitute.exchange').operator()<cr>
nmap sxx <cmd>lua require('substitute.exchange').line()<cr>
xmap X <cmd>lua require('substitute.exchange').visual()<cr>
nmap sxc <cmd>lua require('substitute.exchange').cancel()<cr>
<


Expand Down

0 comments on commit 3ffc5cf

Please sign in to comment.