Updates with copilot.lua

Even though the completion indent is broken...
https://github.com/zbirenbaum/copilot-cmp/issues/45

copilot.vim doesn't display any virtual text either since nvim-cmp
overrides it.
This commit is contained in:
Tyler Hallada 2023-12-01 15:26:00 -05:00
parent 61298ee2f0
commit 78857ba736
5 changed files with 13 additions and 8 deletions

View File

@ -336,9 +336,10 @@ return require('packer').startup(function(use)
use {
'zbirenbaum/copilot-cmp',
config = function ()
require('copilot_cmp').setup()
require('plugins.copilot-cmp')
end
}
-- use 'github/copilot.vim'
use 'ziglang/zig.vim'
use {
'akinsho/bufferline.nvim',

View File

@ -0,0 +1,3 @@
local cmp = require('copilot_cmp')
cmp.setup()

View File

@ -1,4 +1,3 @@
require('mason-lspconfig').setup({
ensure_installed = { 'lua_ls', 'rust_analyzer', 'bashls', 'cssls', 'html', 'jsonls', 'sqls', 'taplo'},
automatic_installation = true,
})

View File

@ -44,17 +44,17 @@ cmp.setup({
end, { "i", "s" }),
}),
sources = cmp.config.sources({
{ name = "copilot", priority = 100, group_index = 1 },
{
name = 'nvim_lsp_signature_help',
priority = 100,
group_index = 1,
priority = 90,
group_index = 2,
},
{
name = 'nvim_lsp',
priority = 100,
group_index = 1,
priority = 90,
group_index = 2,
},
{ name = "copilot", group_index = 2 },
{
name = 'buffer',
priority = 80,
@ -93,7 +93,7 @@ cmp.setup({
mode = 'symbol_text',
maxwidth = 50,
ellipsis_char = '',
symbol_map = { Copilot = '🤖' },
-- symbol_map = { Copilot = '🤖' },
})
}
})

View File

@ -37,3 +37,5 @@ vim.keymap.set('n', '<leader>s', [[<CMD>SqlsExecuteQuery<CR>]], { noremap = fals
vim.keymap.set('n', '<leader>S', [[<CMD>SqlsExecuteQueryVertical<CR>]], { noremap = false, silent = true, desc = "[S]qls execute query under cursor in vertical split" })
vim.keymap.set('x', '<leader>s', [[<Plug>(sqls-execute-query)<CR>]], { noremap = false, silent = true, desc = "[S]qls execute selected query" })
vim.keymap.set('x', '<leader>S', [[<Plug>(sqls-execute-query-vertical)<CR>]], { noremap = false, silent = true, desc = "[S]qls execute selected query in vertical split" })
vim.keymap.set("n", "<leader>bo", "<cmd>%bd|e#<cr>", { desc = "Close all buffers but the current one" }) -- https://stackoverflow.com/a/42071865/516188