Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the copilot #15

Merged
merged 2 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,17 @@ end

if doom.features.lsp ~= nil then
doom.features.lsp.requires_modules = { "features.auto_install" }
doom.features.lsp.settings.completion.sources = {
{ name = "copilot" },
{ name = "nvim_lua" },
tuanbass marked this conversation as resolved.
Show resolved Hide resolved
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "path" },
{ name = "buffer" },
}
end


-- not hide file with any prifix
doom.features.explorer.settings.filters.custom={}
-- doom.features.
Expand Down
38 changes: 38 additions & 0 deletions lua/user/modules/features/copilot/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
local M = {}

M.settings = {}
tuanbass marked this conversation as resolved.
Show resolved Hide resolved

M.packages = {

["copilot.vim"] = {
"github/copilot.vim",
},
}
-- local function getMappings1()
-- return key_mappings;
-- end

M.configs = {
-- ["copilot-cmp"] = function()
-- require("copilot_cmp").setup()
-- end,
}

M.autocmds = {}

M.cmds = {}
-- M.requires_modules = { "features.auto_install" }
-- M.binds = {
-- {
-- "<leader>go",
-- [[<cmd>Octo actions<CR>]],
-- name = "Octo menu",
-- mode = "nv",
-- },
-- }

-- Notes:
-- code for load module located at doom.core.module.load_modules
-- code for binding: ddom.services.keymaps.applyKeymaps

return M
68 changes: 68 additions & 0 deletions lua/user/modules/features/copilot2/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
local M = {}

M.settings = {}

M.packages = {

["copilot.lua"] = {
"zbirenbaum/copilot.lua",
-- cmd = "Copilot",
-- event = "InsertEnter",
},
["copilot-cmp"] = {
"zbirenbaum/copilot-cmp",
after = { "copilot.lua" },
},
-- ["vimade"] = {
-- "TaDaa/vimade",
-- },
}
-- local function getMappings1()
-- return key_mappings;
-- end

M.configs = {
["copilot-cmp"] = function()
require("copilot_cmp").setup()
end,
["copilot.lua"] = function()
-- require("copilot").setup({
-- suggestion = {
-- auto_trigger = true,
-- keymap = {
-- accept = "<C-a>",
-- },
-- },
-- })
vim.defer_fn(function()
require("copilot").setup({
suggestion = { enabled = false },
panel = { enabled = false },
})
end, 100)

-- require("copilot").setup({
-- suggestion = { enabled = false },
-- panel = { enabled = false },
-- })
end,
}

M.autocmds = {}

M.cmds = {}
-- M.requires_modules = { "features.auto_install" }
-- M.binds = {
-- {
-- "<leader>go",
-- [[<cmd>Octo actions<CR>]],
-- name = "Octo menu",
-- mode = "nv",
-- },
-- }

-- Notes:
-- code for load module located at doom.core.module.load_modules
-- code for binding: ddom.services.keymaps.applyKeymaps

return M
2 changes: 2 additions & 0 deletions modules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ return {
"entertainments",
"scratch",
"github",
-- "copilot", -- Copilot using standard Copilot from github/tpope
"copilot2", -- Copilot using Copilot lua plugin from zbirenbaum
-- -- "charcounter", -- custom module test
},

Expand Down