Added copilot cmp plugin
This commit is contained in:
parent
d1995732e5
commit
9fd86b7911
22
config/nvim/lua/user/lsp/config/lua_ls.lua
Normal file
22
config/nvim/lua/user/lsp/config/lua_ls.lua
Normal 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,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
20
config/nvim/lua/user/plugins/cmp.lua
Normal file
20
config/nvim/lua/user/plugins/cmp.lua
Normal 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
|
||||||
27
config/nvim/lua/user/plugins/lspkind.lua
Normal file
27
config/nvim/lua/user/plugins/lspkind.lua
Normal 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"})
|
||||||
|
}
|
||||||
@ -1,14 +1,16 @@
|
|||||||
return {
|
return {
|
||||||
-- You can also add new plugins here as well:
|
-- Signatures plugin to show function signatures as you type them
|
||||||
-- Add plugins, the lazy syntax
|
{
|
||||||
-- "andweeb/presence.nvim",
|
"ray-x/lsp_signature.nvim",
|
||||||
-- {
|
event = "BufRead",
|
||||||
-- "ray-x/lsp_signature.nvim",
|
config = function()
|
||||||
-- event = "BufRead",
|
require("lsp_signature").setup {
|
||||||
-- config = function()
|
hint_enable = false,
|
||||||
-- require("lsp_signature").setup()
|
}
|
||||||
-- end,
|
end,
|
||||||
-- },
|
},
|
||||||
|
|
||||||
|
-- Rooter plugin to change directory to the project root
|
||||||
{
|
{
|
||||||
"notjedi/nvim-rooter.lua",
|
"notjedi/nvim-rooter.lua",
|
||||||
event = "UIEnter",
|
event = "UIEnter",
|
||||||
@ -20,11 +22,32 @@ return {
|
|||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Leap plugin to jump to any line in the file
|
||||||
{
|
{
|
||||||
"ggandor/leap.nvim",
|
"ggandor/leap.nvim",
|
||||||
event = "UIEnter",
|
event = "UIEnter",
|
||||||
|
config = function() require("leap").add_default_mappings() end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Copilot plugin to autocomplete text
|
||||||
|
{
|
||||||
|
"zbirenbaum/copilot.lua",
|
||||||
|
cmd = "Copilot",
|
||||||
|
event = "InsertEnter",
|
||||||
config = function()
|
config = function()
|
||||||
require("leap").add_default_mappings()
|
require("copilot").setup {
|
||||||
|
suggestion = { enabled = false },
|
||||||
|
panel = { enabled = false },
|
||||||
|
filetypes = { markdown = true },
|
||||||
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Copilot CMP plugin to autocomplete text in the completion menu
|
||||||
|
{
|
||||||
|
"zbirenbaum/copilot-cmp",
|
||||||
|
event = "InsertEnter",
|
||||||
|
config = function() require("copilot_cmp").setup() end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user