add copilot to experiment with

writing
Nick Zana 2 years ago
parent 27e98ad1ad
commit 22b35de08e

@ -51,6 +51,20 @@ map('n', '<leader>dp', '<cmd>diffput<CR>', options)
map('n', '<leader>gh', '<cmd>diffget //2<CR>', options) -- merge from left pane map('n', '<leader>gh', '<cmd>diffget //2<CR>', options) -- merge from left pane
map('n', '<leader>gl', '<cmd>diffget //3<CR>', options) -- merge from right pane map('n', '<leader>gl', '<cmd>diffget //3<CR>', options) -- merge from right pane
vim.keymap.set(
"i",
"<Plug>(vimrc:copilot-dummy-map)",
'copilot#Accept("")',
{ silent = true, expr = true, desc = "Copilot dummy accept" }
)
-- remap copilot key to <C-j>
vim.g.copilot_no_tab_map = true
vim.g.copilot_assume_mapped = true
local map = vim.keymap.set
map("i", "<C-j>", "copilot#Accept('<CR>')", {noremap = true, silent = true, expr=true, replace_keycodes = false })
-- LSP -- LSP
-- Use an on_attach function to only map the following keys -- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer -- after the language server attaches to the current buffer

@ -23,6 +23,9 @@ local cmp_config = lsp.defaults.cmp_config({
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'luasnip' }, { name = 'luasnip' },
}, },
experimental = {
ghost_text = false -- conflicts with copilot.vim's preview
},
}) })
cmp.setup(cmp_config) cmp.setup(cmp_config)

@ -23,6 +23,11 @@ local plugins = require('packer').startup(function(use)
run = ':TSUpdate' run = ':TSUpdate'
} }
use {
'https://github.com/github/copilot.vim',
keys = "<C-P>",
}
-- lsp -- lsp
use { use {
'VonHeikemen/lsp-zero.nvim', 'VonHeikemen/lsp-zero.nvim',

Loading…
Cancel
Save