From 109881e4cdde2d851933f050c6cb60c08b96367f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E9=85=94=E9=96=91=E5=90=9F?= <50296129+Jint-lzxy@users.noreply.github.com> Date: Sat, 25 Mar 2023 13:01:48 +0800 Subject: [PATCH] pref(cmp)!: update keymap for `cmp.close` This commit changes the keymap for `cmp.close` from `` to ``. This way: * Makes the keymap more intuitive and easier to memorize (`` -> Close the focused window on most platforms) * Makes `cmp.close` easier to type _(`w` is closer to `` than `e`)_ As this change does not conflict with `` in normal mode, no conflicting keymap was found for the time being. --- dots.tutor | 2 +- lua/modules/configs/completion/cmp.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dots.tutor b/dots.tutor index 1be08b391..3f899cc2f 100644 --- a/dots.tutor +++ b/dots.tutor @@ -105,7 +105,7 @@ The completion window will always show no matter what file you are editing. You can use ``{normal} and ``{normal} to select next and previous candidate in the completion window and use ``{normal} to confirm completion. You can also use ``{normal} and ``{normal} and ``{normal} to do it. Sometimes you don't want confirm -completion but just want to new a line, you can use ``{normal} to close the +completion but just want to new a line, you can use ``{normal} to close the window manually. There are more functions provided by lsp besides code completion. diff --git a/lua/modules/configs/completion/cmp.lua b/lua/modules/configs/completion/cmp.lua index 7b074dd34..ebe186fb9 100644 --- a/lua/modules/configs/completion/cmp.lua +++ b/lua/modules/configs/completion/cmp.lua @@ -92,7 +92,7 @@ return function() [""] = cmp.mapping.select_next_item(), [""] = cmp.mapping.scroll_docs(-4), [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.close(), + [""] = cmp.mapping.close(), [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item()