Added copilot cmp plugin

This commit is contained in:
Christoffer Martinsson 2023-06-03 21:47:30 +02:00
parent d1995732e5
commit 9fd86b7911
4 changed files with 103 additions and 11 deletions

View File

@ -0,0 +1,22 @@
return {
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { "vim" },
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
},
}

View File

@ -0,0 +1,20 @@
return {
"hrsh7th/nvim-cmp",
-- override the options table that is used in the `require("cmp").setup()` call
opts = function(_, opts)
-- opts parameter is the default options table
-- the function is lazy loaded so cmp is able to be required
local cmp = require "cmp"
-- modify the sources part of the options table
opts.sources = cmp.config.sources {
{ name = "nvim_lsp", priority = 1000 },
{ name = "luasnip", priority = 750 },
{ name = "buffer", priority = 500 },
{ name = "path", priority = 250 },
{ name = "copilot", priority = 100 },
}
-- return the new table to be used
return opts
end,
} -- override nvim-cmp plugin

View File

@ -0,0 +1,27 @@
return {
"onsails/lspkind.nvim",
opts = {
mode = "symbol",
symbol_map = {
NONE = "",
Array = "",
Boolean = "",
Class = "",
Constructor = "",
Key = "",
Namespace = "",
Null = "NULL",
Number = "#",
Object = "⦿",
Package = "",
Property = "",
Reference = "",
Snippet = "",
String = "𝓐",
TypeParameter = "",
Unit = "",
Copilot = "",
},
},
vim.api.nvim_set_hl(0, "CmpItemKindCopilot", {fg ="#6CC644"})
}

View File

@ -1,14 +1,16 @@
return {
-- You can also add new plugins here as well:
-- Add plugins, the lazy syntax
-- "andweeb/presence.nvim",
-- {
-- "ray-x/lsp_signature.nvim",
-- event = "BufRead",
-- config = function()
-- require("lsp_signature").setup()
-- end,
-- },
-- Signatures plugin to show function signatures as you type them
{
"ray-x/lsp_signature.nvim",
event = "BufRead",
config = function()
require("lsp_signature").setup {
hint_enable = false,
}
end,
},
-- Rooter plugin to change directory to the project root
{
"notjedi/nvim-rooter.lua",
event = "UIEnter",
@ -20,11 +22,32 @@ return {
}
end,
},
-- Leap plugin to jump to any line in the file
{
"ggandor/leap.nvim",
event = "UIEnter",
config = function() require("leap").add_default_mappings() end,
},
-- Copilot plugin to autocomplete text
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
config = function()
require("leap").add_default_mappings()
require("copilot").setup {
suggestion = { enabled = false },
panel = { enabled = false },
filetypes = { markdown = true },
}
end,
},
-- Copilot CMP plugin to autocomplete text in the completion menu
{
"zbirenbaum/copilot-cmp",
event = "InsertEnter",
config = function() require("copilot_cmp").setup() end,
},
}