Skip to content

Commit

Permalink
docs: added missing usage of cmp
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarcosp committed Jun 12, 2024
1 parent fb570b5 commit bd8d584
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions mappings/custom-mappings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,24 @@ Now, you can use `<leader>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 = "<C-d>",
scroll_docs_up = "<C-u>",
next_item = "<C-n>",
prev_item = "<C-p>",
show_list = "<C-Space>",
confirm = "<CR>",
},
before_default_sources = {},
after_default_sources = {},
}
```


0 comments on commit bd8d584

Please sign in to comment.