From b4d4ae66a49ff2ebb171971ec7174fef98d1095c Mon Sep 17 00:00:00 2001 From: Fernando Daciuk Date: Tue, 11 Jun 2024 22:30:45 -0300 Subject: [PATCH] fix: nvim-cmp docs --- mappings/custom-mappings.mdx | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/mappings/custom-mappings.mdx b/mappings/custom-mappings.mdx index 4dfa196..523281a 100644 --- a/mappings/custom-mappings.mdx +++ b/mappings/custom-mappings.mdx @@ -89,21 +89,26 @@ from the Neovim official documentation. ### Custom mappings for autocomplete (cmp) +You can customize your mappings for autocomplete (`nvim-cmp`) using `lua`, just use the `cmp` entry in your configuration. +Check out the example below with defaults: -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 = {}, +return { + cmp = { + mappings = { + scroll_docs_down = "", + scroll_docs_up = "", + next_item = "", + prev_item = "", + show_list = "", + confirm = "", + }, + before_default_sources = {}, + after_default_sources = {}, + } } ``` - +The `before_default_sources` and `after_default_sources` options can be used to load +`nvim-cmp` plugins before and after the default sources that is already installed with Better Vim. +If you want to know more about `nvim-cmp` sources, check out the [plugin documentation](https://github.com/hrsh7th/nvim-cmp).