From 8d7439522a194e77051d18c80984133e377862f0 Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Wed, 9 Apr 2025 19:57:39 +0200 Subject: [PATCH] Change autocomplete shortcuts, added shorcut for Lazy --- init.lua | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/init.lua b/init.lua index ff458f44..3911ee07 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,5 @@ --[[ - Lua 15 mins guide - https://learnxinyminutes.com/docs/lua/ + - Lua 15 mins guide - https://learnxinyminutes.com/docs/lua/ - :help lua-guide If you experience any errors while trying to install kickstart, run `:checkhealth` for more info. @@ -257,6 +257,7 @@ require('lazy').setup({ { 'w', group = '[W]orkspace' }, { 't', group = '[T]oggle' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, + { 'm', group = '[M]isc' }, }, }, }, @@ -792,24 +793,28 @@ require('lazy').setup({ -- No, but seriously. Please read `:help ins-completion`, it is really good! mapping = cmp.mapping.preset.insert { -- Select the [n]ext item - [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_next_item(), -- Select the [p]revious item - [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.select_prev_item(), + --[''] = cmp.mapping.select_next_item(), + --[''] = cmp.mapping.select_prev_item(), -- Scroll the documentation window [b]ack / [f]orward - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + -- [''] = cmp.mapping.scroll_docs(-4), + -- [''] = cmp.mapping.scroll_docs(4), -- Accept ([y]es) the completion. -- This will auto-import if your LSP supports it. -- This will expand snippets if the LSP sent a snippet. - [''] = cmp.mapping.confirm { select = true }, + -- [''] = cmp.mapping.confirm { select = true }, + [''] = cmp.mapping.confirm { + behavior = cmp.ConfirmBehavior.Insert, + select = true, + }, - -- If you prefer more traditional completion keymaps, - -- you can uncomment the following lines - --[''] = cmp.mapping.confirm { select = true }, - --[''] = cmp.mapping.select_next_item(), - --[''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.close(), -- Manually trigger a completion from nvim-cmp. -- Generally you don't need this, because nvim-cmp will display @@ -976,6 +981,8 @@ require('lazy').setup({ end, }, + vim.keymap.set('n', 'hl', 'Lazy', { desc = 'Lazy' }), + -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the -- init.lua. If you want these files, they are in the repository, so you can just download them and -- place them in the correct locations.