Skip to content

Commit

Permalink
docs: detail how to add or change mappings
Browse files Browse the repository at this point in the history
Add details on how add or change mappings, letting users know what the
expected value is for a mapping, as it was not clear before.

Closes: GH-91
Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
  • Loading branch information
filipdutescu committed Nov 23, 2021
1 parent 505d4d6 commit c07ecfe
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,19 @@ to users and mimic the default behaviour of their normal mode equivalents.
| `<c-u>` | Undo changes. |
| `<c-r>` | Redo undone changes. |

To change existing mappings or add new ones, the value needed to be passed in the
mappings field is a Lua function. Here is an example of how to change `<c-c>`'s
behaviour from clearing the line to closing the popup:

```lua
-- other setup code...

['<c-c>'] = function()
vim.api.nvim_input('<esc>')
end

-- other setup code...
```

## Media

Expand Down
14 changes: 14 additions & 0 deletions doc/renamer.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,20 @@ described in |renamer.setup|:
See `:help CTRL-R`


To change existing mappings or add new ones, the value needed to be passed in the
mappings field is a Lua function. Here is an example of how to change `<c-c>`'s
behaviour from clearing the line to closing the popup:
>
-- other setup code...
['<c-c>'] = function()
vim.api.nvim_input('<esc>')
end
-- other setup code...
<



===============================================================================
*renamer.highlights*
Expand Down

0 comments on commit c07ecfe

Please sign in to comment.