diff --git a/mappings/custom-mappings.mdx b/mappings/custom-mappings.mdx index f1575c3..4dfa196 100644 --- a/mappings/custom-mappings.mdx +++ b/mappings/custom-mappings.mdx @@ -86,3 +86,24 @@ Now, you can use `h1` to go to tab 1, instead of `alt` + `1`. To create custom mappings using `lua` you can use the `hooks.after_setup` entry in `better-vim.lua` file, following this [tutorial](https://neovim.io/doc/user/lua-guide.html#lua-guide-mappings) from the Neovim official documentation. + +### Custom mappings for autocomplete (cmp) + + +To create custom mappings for autocomplete (`cmp`) using `lua`, you can use the `cmp` entry in your configuration. Check out the example below: +```lua better-vim.lua +M.cmp = { + mappings = { + scroll_docs_down = "", + scroll_docs_up = "", + next_item = "", + prev_item = "", + show_list = "", + confirm = "", + }, + before_default_sources = {}, + after_default_sources = {}, +} +``` + +