diff options
| author | Aotrix <[email protected]> | 2025-02-14 14:46:43 +0100 |
|---|---|---|
| committer | Aotrix <[email protected]> | 2025-02-14 14:46:43 +0100 |
| commit | b36a473877108e8f767abb8c24af3561a65661ec (patch) | |
| tree | a7cba9cbb480f77a13c2eb2977055b9bddc52d35 /lua/autocomplete/autocomplete.lua | |
| parent | fb83b971f68656ad6ed852db343883f998c60984 (diff) | |
changed some mappings
Diffstat (limited to 'lua/autocomplete/autocomplete.lua')
| -rw-r--r-- | lua/autocomplete/autocomplete.lua | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lua/autocomplete/autocomplete.lua b/lua/autocomplete/autocomplete.lua index f5329e1..1e2687b 100644 --- a/lua/autocomplete/autocomplete.lua +++ b/lua/autocomplete/autocomplete.lua @@ -11,17 +11,19 @@ end -- NOTE: Use command ':verbose imap <tab>' to make sure Tab is not mapped by -- other plugins before putting this into your config local opts = {silent = true, noremap = true, expr = true, replace_keycodes = false} -keyset("i", "<TAB>", 'coc#pum#visible() ? coc#pum#next(1) : v:lua.check_back_space() ? "<TAB>" : coc#refresh()', opts) -keyset("i", "<S-TAB>", [[coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"]], opts) +keyset("i", "<c-j>", 'coc#pum#visible() ? coc#pum#next(1) : v:lua.check_back_space() ? "<C-J>" : coc#refresh()', opts) +keyset("i", "<c-k>", [[coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"]], opts) vim.opt.pumheight = 12 -- Make <CR> to accept selected completion item or notify coc.nvim to format -- <C-g>u breaks current undo, please make your own choice keyset("i", "<cr>", [[coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"]], opts) --- Use <c-j> to trigger snippets -keyset("i", "<c-j>", "<Plug>(coc-snippets-expand-jump)") +-- keyset("i", "<c-j>", "<Plug>(coc-snippets-expand-jump)") +-- keyset("i", "<c-j>", "<Plug>(coc-snippets-expand-jump)") -- Use <c-space> to trigger completion +vim.g.coc_snippet_next = "<c-n>" +vim.g.coc_snippet_prev = "<c-p>" keyset("i", "<c-space>", "coc#refresh()", {silent = true, expr = true}) -- Use `[g` and `]g` to navigate diagnostics @@ -118,9 +120,9 @@ local opts = {silent = true, nowait = true, expr = true} keyset("n", "<C-f>", 'coc#float#has_scroll() ? coc#float#scroll(1) : "<C-f>"', opts) keyset("n", "<C-b>", 'coc#float#has_scroll() ? coc#float#scroll(0) : "<C-b>"', opts) keyset("i", "<C-f>", - 'coc#float#has_scroll() ? "<c-r>=coc#float#scroll(1)<cr>" : "<Right>"', opts) +'coc#float#has_scroll() ? "<c-r>=coc#float#scroll(1)<cr>" : "<Right>"', opts) keyset("i", "<C-b>", - 'coc#float#has_scroll() ? "<c-r>=coc#float#scroll(0)<cr>" : "<Left>"', opts) +'coc#float#has_scroll() ? "<c-r>=coc#float#scroll(0)<cr>" : "<Left>"', opts) keyset("v", "<C-f>", 'coc#float#has_scroll() ? coc#float#scroll(1) : "<C-f>"', opts) keyset("v", "<C-b>", 'coc#float#has_scroll() ? coc#float#scroll(0) : "<C-b>"', opts) |
