Giter VIP home page Giter VIP logo

copilot.lua's Introduction

copilot.lua

This plugin is the pure lua replacement for github/copilot.vim.

Motivation behind `copilot.lua`

While using copilot.vim, for the first time since I started using neovim my laptop began to overheat. Additionally, I found the large chunks of ghost text moving around my code, and interfering with my existing cmp ghost text disturbing. As lua is far more efficient and makes things easier to integrate with modern plugins, this repository was created.

Install

Install the plugin with your preferred plugin manager. For example, with packer.nvim:

use { "zbirenbaum/copilot.lua" }

Authentication

Once copilot is running, run :Copilot auth to start the authentication process.

Setup and Configuration

You have to run the require("copilot").setup(options) function in order to start Copilot. If no options are provided, the defaults are used.

Because the copilot server takes some time to start up, it is recommend that you lazy load copilot. For example:

use {
  "zbirenbaum/copilot.lua",
  cmd = "Copilot",
  event = "InsertEnter",
  config = function()
    require("copilot").setup({})
  end,
}

The following is the default configuration:

require('copilot').setup({
  panel = {
    enabled = true,
    auto_refresh = false,
    keymap = {
      jump_prev = "[[",
      jump_next = "]]",
      accept = "<CR>",
      refresh = "gr",
      open = "<M-CR>"
    },
    layout = {
      position = "bottom", -- | top | left | right
      ratio = 0.4
    },
  },
  suggestion = {
    enabled = true,
    auto_trigger = false,
    debounce = 75,
    keymap = {
      accept = "<M-l>",
      accept_word = false,
      accept_line = false,
      next = "<M-]>",
      prev = "<M-[>",
      dismiss = "<C-]>",
    },
  },
  filetypes = {
    yaml = false,
    markdown = false,
    help = false,
    gitcommit = false,
    gitrebase = false,
    hgcommit = false,
    svn = false,
    cvs = false,
    ["."] = false,
  },
  copilot_node_command = 'node', -- Node.js version must be > 18.x
  server_opts_overrides = {},
})

panel

Panel can be used to preview suggestions in a split window. You can run the :Copilot panel command to open it.

If auto_refresh is true, the suggestions are refreshed as you type in the buffer.

The copilot.panel module exposes the following functions:

require("copilot.panel").accept()
require("copilot.panel").jump_next()
require("copilot.panel").jump_prev()
require("copilot.panel").open({position, ratio})
require("copilot.panel").refresh()

suggestion

When auto_trigger is true, copilot starts suggesting as soon as you enter insert mode.

When auto_trigger is false, use the next or prev keymap to trigger copilot suggestion.

To toggle auto trigger for the current buffer, use require("copilot.suggestion").toggle_auto_trigger().

Copilot suggestion is automatically hidden when popupmenu-completion is open. In case you use a custom menu for completion, you can set the copilot_suggestion_hidden buffer variable to true to have the same behavior. For example, with nvim-cmp:

cmp.event:on("menu_opened", function()
  vim.b.copilot_suggestion_hidden = true
end)

cmp.event:on("menu_closed", function()
  vim.b.copilot_suggestion_hidden = false
end)

The copilot.suggestion module exposes the following functions:

require("copilot.suggestion").is_visible()
require("copilot.suggestion").accept(modifier)
require("copilot.suggestion").accept_word()
require("copilot.suggestion").accept_line()
require("copilot.suggestion").next()
require("copilot.suggestion").prev()
require("copilot.suggestion").dismiss()
require("copilot.suggestion").toggle_auto_trigger()

filetypes

Specify filetypes for attaching copilot.

Example:

require("copilot").setup {
  filetypes = {
    markdown = true, -- overrides default
    terraform = false, -- disallow specific filetype
    sh = function ()
      if string.match(vim.fs.basename(vim.api.nvim_buf_get_name(0)), '^%.env.*') then
        -- disable for .env files
        return false
      end
      return true
    end,
  },
}

If you add "*" as a filetype, the default configuration for filetypes won't be used anymore. e.g.

require("copilot").setup {
  filetypes = {
    javascript = true, -- allow specific filetype
    typescript = true, -- allow specific filetype
    ["*"] = false, -- disable for all other filetypes and ignore default `filetypes`
  },
}

copilot_node_command

Use this field to provide the path to a specific node version such as one installed by nvm. Node.js version must be 18.x or newer.

Example:

copilot_node_command = vim.fn.expand("$HOME") .. "/.config/nvm/versions/node/v18.18.2/bin/node", -- Node.js version must be > 18.x

server_opts_overrides

Override copilot lsp client settings. The settings field is where you can set the values of the options defined in SettingsOpts.md. These options are specific to the copilot lsp and can be used to customize its behavior. Ensure that the name field is not overriden as is is used for efficiency reasons in numerous checks to verify copilot is actually running. See :h vim.lsp.start_client for list of options.

Example:

require("copilot").setup {
  server_opts_overrides = {
    trace = "verbose",
    settings = {
      advanced = {
        listCount = 10, -- #completions for panel
        inlineSuggestCount = 3, -- #completions for getCompletions
      }
    },
  }
}

Commands

copilot.lua defines the :Copilot command that can perform various actions. It has completion support, so try it out.

Integrations

The copilot.api module can be used to build integrations on top of copilot.lua.

copilot.lua's People

Contributors

alexwu avatar andrem222 avatar charleschiugit avatar danielweidinger avatar dsully avatar ethanwng97 avatar gearcog avatar github-actions[bot] avatar groveer avatar gskll avatar jcapblancq avatar johnf avatar joshuachp avatar mariasolos avatar mosheavni avatar muniftanjim avatar rockofox avatar sbulav avatar y9c avatar zbirenbaum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

copilot.lua's Issues

Copilot is not completing the whole suggestion

I don't know if it is an issue with copilot.lua itself, but perhaps you'll be able to point me out to the right direction.

Lets say I have a code like this and the cursor is at the |:

require('copilot').setup({
    cmp = {
        enabled = true,
        method = "getCompletionsCycling",
    },
    ft_disable = {},
    plugin_manager_path = vim.fn.stdpath("data") .. "/site/pack/packer",
    server_opts_overrides = {},
    |
}

If I type panel and copilot suggests:

    panel = {
        enabled = true,
    }

The result looks like this:

require('copilot').setup({
    cmp = {
        enabled = true,
        method = "getCompletionsCycling",
    },
    ft_disable = {},
    plugin_manager_path = vim.fn.stdpath("data") .. "/site/pack/packer",
    server_opts_overrides = {},
    panel = {
        enabled = true,

}

It won't put the last bracket because it thinks it is already there. If I do the same thing but the cursor between the options where the next character is not the same as the last from the suggestion it works fine.

Can not get any suggestions from copilot.lua

I just Can not get any suggestions on nvim-cmp. And after I do some debug on it, I find that is a problem from copilot.lua.
handles.lua The next functions can not be called.

local handlers = {
  ["PanelSolution"] = function (_, result, _, config)
    print("handlers PanelSolution")
    if not result then return "err" end
    if result.panelId and config.callbacks[result.panelId] then
      config.callbacks[result.panelId](result)
    elseif not config.callbacks[result.panelId] and result.panelId then
      return
    else
      for _, callback in pairs(config.callbacks) do callback() end
    end
  end,

  ["PanelSolutionsDone"] = function (_, _, _, config)
    print("handlers PanelSolutionsDone")
    for _, callback in pairs(config.callbacks) do
      callback()
    end
  end
}

I can got one suggestion in placeholder, but not in nvim-cmp window.
image

ENV:
nvim: v0.7.0
os: macos 12.4

error running config in lunarvim

image

my plugin config

	{
		"zbirenbaum/copilot.lua",
		event = { "VimEnter" },
		config = function()
			vim.defer_fn(function()
				require("copilot").setup({
					plugin_manager_path = "/Users/MHuggins/.local/share/lunarvim/site/pack/packer"
				})
			end, 100)
		end,
	},

LSP attaches to all buffers.

Currently the LSP client appears to attach to all buffers, including ones like Packer, nofile, etc.

It would be nice to have it take a table of ignored file and buffer types.

Incorrect indenting

When accepting a completion it places the text at the first column instead of keeping the current indent / cursor position
Plugin list:
image

I tried this:
image
per this issue:
zbirenbaum/copilot-cmp#11
didn't fix it for me.

jk yea it did im dumb :)

Copilot agent throwing errors with foreign characters

Hello there,

I have noticed that suggestions containing foreign characters are causing the copilot node process to throw errors:

[ERROR][2022-06-21 10:47:21] .../vim/lsp/rpc.lua:420	"rpc"	"node"	"stderr"	"[ERROR] [streamChoices] [2022-06-21T08:47:21.693Z] Invalid streamingData\n"
[ERROR][2022-06-21 10:47:21] .../vim/lsp/rpc.lua:420	"rpc"	"node"	"stderr"	"[ERROR] [streamChoices] [2022-06-21T08:47:21.693Z] Invalid streamingData joinedText:[{\n   \"א'\", \"ב'\", \"ג'\", \"ד'\", \"ה'\", \"ו'\", \"ש'\",\n}\n] not a substring of joinedTokens:[ {\n   \"א'\", \"ב'\", \"bytes:\\xd7bytes:\\x92'\", \"bytes:\\xd7bytes:\\x93'\", \"ה'\", \"ו'\", \"ש'\",\n}\n]\n"

Where is the js code coming from?

Breaking Change in Config

Just change the following line in your plugin configuration from:
require("copilot")
to
require("copilot").setup()

Can't re-authenticate.

I'm getting spammed with messages that my preview expired. I need to sign out and in to get paid plan working.

But it seems I can't remove old token. How can I sign out, or where is token stored on machine?

Copilot.vim offers signout function

Issue from copilot here --> community/community#39533

copilot.lua not working

When I try to run lua require('copilot').setup() it returns this:

E5108: Error executing lua [string ":lua"]:1: module 'copilot' not found:
        no field package.preload['copilot']
        no file './copilot.lua'
        no file '/opt/homebrew/share/luajit-2.1.0-beta3/copilot.lua'
        no file '/usr/local/share/lua/5.1/copilot.lua'
        no file '/usr/local/share/lua/5.1/copilot/init.lua'
        no file '/opt/homebrew/share/lua/5.1/copilot.lua'
        no file '/opt/homebrew/share/lua/5.1/copilot/init.lua'
        no file '/Users/marcelmanzanares2/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/copilot.lua'
        no file '/Users/marcelmanzanares2/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/copilot/init.lua'
        no file '/Users/marcelmanzanares2/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/copilot.lua'
        no file '/Users/marcelmanzanares2/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/copilot/init.lua'
        no file '/Users/marcelmanzanares2/.local/share/nvim/site/pack/packer/start/nvim-highlight-colors/plugin/../lua/example-plugin/deps/lua-copilot/init.lua'
        no file './copilot.so'
        no file '/usr/local/lib/lua/5.1/copilot.so'
        no file '/opt/homebrew/lib/lua/5.1/copilot.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file '/Users/marcelmanzanares2/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/copilot.so'
stack traceback:
        [C]: in function 'require'
        [string ":lua"]:1: in main chunk

copilot is installed and this is the config:

		use {
			"hrsh7th/nvim-cmp",
			requires = {
				"hrsh7th/cmp-buffer",
			},
		}
		use {
			"zbirenbaum/copilot.lua",
			event = "VimEnter",
			config = function()
				vim.defer_fn(function()
					require("copilot").setup()
				end, 100)
			end,
		}
		use { "zbirenbaum/copilot-cmp", after = { "copilot.lua", "nvim-cmp" } }

Compatibility with windows

Is this repo compatible with windows? I tried to do the setup, but it did not go through (up to the step where it asks to press enter to confirm).
The output there changes sometimes, so I am not sure if this was tested on windows (I did not try on linux).

Option to disable Copilot for certain directories / files whose path matches certain patterns

Motivation

I want to disable Copilot for my university assignments to avoid the risk of cheating. So I want to disable Copilot for all files in a particular directory.

Feature Request

Add an option to disable Copilot for certain directories or files whose path matches certain patterns.

Or provide example config scripts if this can be done by the user without modifying the plugin. I tried running setup conditionally and using autocmd but with no luck.

Don't mess with `InsertEnter` event when inserting suggestions

I just switched from copilot.vim and I notice whenever I accept a suggestion copilot.lua temporarily toggles the InsertEnter event. Unfortunately, this kicks me out of Zen Mode and also randomly highlights the buffer.

The copilot.vim approach of inserting suggestions without messing the InsertEnter event is far more preferable and less disruptive, especially for plugins or features that rely on the InsertEnter state to work, like my custom Zen Mode feature.

Can you adopt the copilot.vim approach?

I also notice that after inserting suggestions, the cursor is placed on the last character of the suggestion instead of after it. Is there a way to change this behavior?

I don't use nvim-cmp. Here's my settings.

local status_ok, copilot = pcall(require, "copilot")

if not status_ok then
  return
end

local home = vim.fn.expand("$HOME")

copilot.setup({
  filter = { ["."] = false },
  suggestion = {
    debounce = 1000,
    auto_trigger = true,
    keymap = {
      accept = "<tab>",
      next = "<c-j>",
      prev = "<c-k>",
      dismiss = "<c-\\>",
    },
  },
  copilot_node_command = home .. "/.nvm/versions/node/v16.15.0/bin/node",
})

Getting a module 'copilot-cmp' not found with packer

Here's the config that I used

{
  "zbirenbaum/copilot.lua",
  event = { "VimEnter" },
  config = function()
    vim.defer_fn(function()
      print("copilot enter")
      require("copilot").setup()
    end, 100)
  end,
},
{
  "zbirenbaum/copilot-cmp",
  after = { "copilot.lua" },
  config = function()
    print("copilot cmp enter")
    require("copilot-cmp").config()
  end,
},

Here's the error that I got

packer.nvim: Error running config for copilot-cmp: [string "..."]:0: module 'copilot-cmp' not found:
^Ino field package.preload['copilot-cmp']
^Ino file './copilot-cmp.lua'
^Ino file '/usr/share/luajit-2.1.0-beta3/copilot-cmp.lua'
^Ino file '/usr/local/share/lua/5.1/copilot-cmp.lua'
^Ino file '/usr/local/share/lua/5.1/copilot-cmp/init.lua'
^Ino file '/usr/share/lua/5.1/copilot-cmp.lua'
^Ino file '/usr/share/lua/5.1/copilot-cmp/init.lua'
^Ino file './copilot-cmp.so'
^Ino file '/usr/local/lib/lua/5.1/copilot-cmp.so'
^Ino file '/usr/lib64/lua/5.1/copilot-cmp.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'

Poll: Virtual Text and Show In Buffer

So alongside working on the api, the way I have been testing it is by implementing the features inside of copilot.vim, including making a constant request loop with configurable polling time and handlers.

Virtual text needs a bit more work, but I have it very close to exactly the same experience you would have working on copilot.vim.

Showing results in a dedicated buffer is something I developed as a debugging tool, but it would be very simple to include. It would also be simple to make this a floating window.

Once, these are fully done, all that would be left to have copilot.vim's experience fully implemented are a couple of small features here and there, and authentication through my plugin rather than generating the json file with copilot.vim

My question is as follows: Would you, as users, like the completion buffer and vtext to be included in the core repository, or, would you like to have ONLY the event loop api and required hooks for creating such a handler yourself in the core repo, and include examples on how to use the api to implement handlers such as the ones mentioned inside of the documentation.

Currently, I am leaning towards keeping them in the docs, as it would keep the source cleaner, but I am not sure how heavy the desire for these features are so I figured it would be best to ask. If enough people want it out of the box, I'm happy to include it.

As a side note: While this work is being accomplished in development branches available on github, I would discourage anyone from trying to use them currently, as they are still quite buggy, and the api is subject to change once I have everything done and can plan out the exact structure of all necessary hooks.

If you would like to assist in their development, feel free to offer input or PR, but don't be offended if I don't merge it, as pretty much every aspect of the api is subject to change until I think it's ready to go on the main branch.

Vote 👍 to include them, and 👎 to make them part of the documentation

Breaking Changes

Copilot-cmp's setup function will no longer be executed by copilot.lua in order to keep the codebase consistent and reduce complexity in light of the new formatter function overrides. Review the README for updated setup instructions.

[Bug] `cmd` override in `copilot.lua` setup doesn't produce any effect

My packer.nvim config:

    {
      "zbirenbaum/copilot.lua",
      -- event = {"VimEnter"},
      after = "nvim-cmp",
      requires = {"zbirenbaum/copilot-cmp"},
      config = function()
        local cmp_source = { name = "copilot", group_index = 2 }
        table.insert(lvim.builtin.cmp.sources, cmp_source)
        local plugin_manager_path = require("lvim.utils").join_paths(get_runtime_dir(), "site", "pack", "packer")
        vim.defer_fn(function()
          require("copilot").setup {
            plugin_manager_path = plugin_manager_path,
            server_opts_overrides = {
              cmd = { "node", require("copilot.util").get_copilot_path(plugin_manager_path) }
            },
          }
        end, 100)
      end,
    },

As a result, copilot.lua starts a LSP server using the default cmd string.

This also applies to other server_opts_overrides fields such as trace and name.

Remove possible closing bracket (or whatever closing pair)

Hi,

i'm facing following minor annoyance and i was wondering, if that's something this plugin COULD fix, or i need to find another solution:

so i'm using nvim-autopairs.... and with copilot snippets this can be a bit annoying. f.e.

someFunc(|)

and the copilot suggestion might already contain a closing bracket, so you end up with

someFunc(copilotsuggestion))

and you now need to remove the extra closing bracket. That's midly annoying.

Any idea how to avoid this?

Regards

not getting any sources on `cmp` from `copilot.lua`

I can't get the source on cmp for copilot.lua, I debugged the sources that arrive at the cmp setup and there is no source coming from copilot.lua so the error should come from this plugin (I think…).

copilot.vim works and the user auth works correctly.

I tried to create a minimal config, but I can't get it to work, here is the minimal config:

-- this template is borrowed from nvim-lspconfig
local on_windows = vim.loop.os_uname().version:match "Windows"

local function join_paths(...)
	local path_sep = on_windows and "\\" or "/"
	local result = table.concat({ ... }, path_sep)
	return result
end

vim.cmd [[set runtimepath=$VIMRUNTIME]]

local temp_dir
if on_windows then
	temp_dir = vim.loop.os_getenv "TEMP"
else
	temp_dir = "/tmp"
end

vim.cmd("set packpath=" .. join_paths(temp_dir, "nvim", "site"))

local package_root = join_paths(temp_dir, "nvim", "site", "pack")
local install_path = join_paths(package_root, "packer", "start", "packer.nvim")
local compile_path = join_paths(install_path, "plugin", "packer_compiled.lua")

local function load_plugins()
	-- only add other plugins if they are necessary to reproduce the issue
	require("packer").startup {
		{
			"wbthomason/packer.nvim",
			{ "neovim/nvim-lspconfig" },
			{ "neovim/nvim-lsp" },
			{ "hrsh7th/nvim-cmp" },
			{ "hrsh7th/cmp-nvim-lsp" },
			{ "github/copilot.vim" }, -- needed for the auth
			{
				"zbirenbaum/copilot.lua",
				event = "VimEnter",
				config = function()
					vim.defer_fn(function()
						require("copilot").setup {}
					end, 100)
				end,
			},
			{
				"zbirenbaum/copilot-cmp",
				after = { "copilot.lua", "nvim-cmp" },
			},
			{ "williamboman/nvim-lsp-installer" },
		},
		config = {
			package_root = package_root,
			compile_path = compile_path,
		},
	}
end

if vim.fn.isdirectory(install_path) == 0 then
	vim.fn.system {
		"git",
		"clone",
		"https://github.com/wbthomason/packer.nvim",
		install_path,
	}
	load_plugins()
	require("packer").sync()
else
	load_plugins()
	require("packer").sync()
end

vim.keymap.set("n", "<Space>w", ":w<cr>")
vim.keymap.set("n", "<Space>q", ":q<cr>")

require "lspconfig"

local cmp = require "cmp"
local kind = cmp.lsp.CompletionItemKind

-- vim.o.completeopt = "menu,menuone,noselect"
vim.opt.completeopt = { "menu", "menuone", "noselect" }

vim.cmd "set shortmess+=c"
vim.cmd "let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy', 'all']"

cmp.setup {
	mapping = {
		["<C-n>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }),
		["<C-p>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }),
		["<C-d>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }),
		["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }),
		["<C-e>"] = cmp.mapping {
			i = cmp.mapping.abort(),
			c = cmp.mapping.close(),
		},
		["<CR>"] = cmp.mapping.confirm {
			select = true,
			behavior = cmp.ConfirmBehavior.Replace,
		},
	},
	experimental = { ghost_text = true },
	sources = {
		{ name = "copilot" },
		{ name = "nvim_lsp", max_item_count = 5 },
	},
}

require("nvim-lsp-installer").setup {}

In my configuration, cmp works with all the other sources without any problem.

Error executing lua E114: Missing quote

I'm using LunarVim, and I added copilot to my Packer config (lvim.plugins) like so:

  -- github copilot
  {
    "zbirenbaum/copilot.lua",
    event = "InsertEnter",
    config = function ()
      vim.schedule(function() require("copilot") end)
    end
  },
  {
    "zbirenbaum/copilot-cmp",
    after = {"copilot.lua", "nvim-cmp"},
    config = function ()
      lvim.builtin.cmp.formatting.source_names["copilot"] = ""
      table.insert(lvim.builtin.cmp.sources, {name = "copilot"})
    end
  },

When I enter insert mode I get this error message:

Error detected while processing InsertEnter Autocommands for "*":
E5108: Error executing lua ...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:165: Vim(echomsg):E114: Missing quote: "Error in packer_compiled: ...m/s
ite/pack/packer/start/packer.nvim/lua/packer/load.lua:142: Vim(source):E5113: Error while calling lua chunk: ...ite/pack/packer/opt/copilot-cmp/lua/copilot_cmp
/init.lua:9: attempt to call field 'nvim_create_autocmd' (a nil value)
stack traceback:
        [C]: in function 'cmd'
        ...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:165: in function <...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:161>
        [string ":lua"]:1: in main chunk

Copilot is about to start charging.

As the letter many of copilot users received today, maybe it's time to look for a open-source AI coding assistant?
I found this cool project in github, maybe there's a way to transform it into a Neovim plugin? This is more like a plugin idea, no need to take it seriously if you're not interested in making one.

Hope this issue won't bother you too much, feel free to close this issue if you think it's irrelevant.

Best!

Error while processing TextChangedI Autocommands

Hey, this looks awesome! I am trying to get it set up but am having issues with some filetypes. For instance, I get this when editing a json file:

Error detected while processing TextChangedI Autocommands for "*":
method getCompletions is not supported by any of the servers registered for the current buffer
  • platform: macos 12.2.1
  • neovim: v0.6.1
  • copilot.lua: latest
  • copilot-cmp: latest

Use vim.json.* rather than vim.fn.*_json

Hi 👋🏿 ,

I was just perusing the code base out of curiosity and noticed that to encode/decode JSON you are using the viml function json_decode/encode. A few months ago I think with 0.6.1 @.mjlbach added support for using Lua cjson which is much faster and can be used via the vim.json module. I think this will probably add some performance improvement to this plugin. Just a heads-up/drive by comment 🤷🏿‍♂️

EDIT: just realized you are only using it in a very isolated part of the project rather than repeatedly, so might not matter so much in the end, anyway 🤷🏿

Not getting suggestions for some languages

Hi,

I'm not getting suggestions when using copilot.lua and copilot.cmp for some languages. I'm not sure what the difference is, Copilot status lists Online and Enabled for typescriptreact (for instance for a *.tsx file). Languages (that I tried) that work are rust, php, css, what don't are javascript/typescript, python. If I remember correctly, all languages worked at some point.

I'm not sure what I can do to narrow down the problem.

Best,
Daniel

doesn't work without copilot.vim

The readme suggests the official plugin is only necessary for the authentication step. However, on both my computers, where ~/.config/github-copilot/hosts.yml already exists, and using https://github.com/zbirenbaum/copilot-cmp, I don't actually get any completions if I remove copilot.vim and then re-run :PackerSync

Is this a bug or outdated docs?

module 'copilot_cmp' not found

Details

I keep getting the following error after installing copilot.lua, I can see copilot in LspInfo so I am not sure what is happening exactly...

  • Neovim v0.7.0 (nvChad)
  • Ubuntu 20.04 (WSL)
  • Fresh setup, config is working on my two of my arch installs

Error

Error executing vim.schedule lua callback: ...im/site/pack/packer/opt/copilot.lua/lua/copilot/init.lua:23: module 'copilot_cmp' not found:
        no field package.preload['copilot_cmp']
        no file './copilot_cmp.lua'
        no file '/home/runner/work/neovim/neovim/.deps/usr/share/luajit-2.1.0-beta3/copilot_cmp.lua'
        no file '/usr/local/share/lua/5.1/copilot_cmp.lua'
        no file '/usr/local/share/lua/5.1/copilot_cmp/init.lua'
        no file '/home/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/copilot_cmp.lua'
        no file '/home/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/copilot_cmp/init.lua'
        no file '/home/x/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/copilot_cmp.lua'
        no file '/home/x/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/copilot_cmp/init.lua'
        no file '/home/x/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/copilot_cmp.lua'
        no file '/home/x/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/copilot_cmp/init.lua'
        no file './copilot_cmp.so'
        no file '/usr/local/lib/lua/5.1/copilot_cmp.so'
        no file '/home/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/copilot_cmp.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file '/home/x/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/copilot_cmp.so'
stack traceback:
        [C]: in function 'require'
        ...im/site/pack/packer/opt/copilot.lua/lua/copilot/init.lua:23: in function 'setup'
        [string "..."]: in function ''
        vim/_editor.lua: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

Idea: Depend on upstream copilot plugin

@zbirenbaum I noticed you recently updated the copilot code.
Have you thought about removing it from this repo and having only the wrapper and then having folks install the github pluginas well.
You could then load it directly and not have to keep updating it here.

I played with this a little when I was doing some testing and you can set some global variables that tells copilot.vim to not load itself. Mainly by telling it not to manage any file extension types.

Set path for "github-copilot" folder

Hi, is this running in windows? I have not been able to make it work, and I was wondering if the file host.json created by copilot in the setup process, is always looked for in "~/.config/github-copilot".

In windows is located at "C:\Users\user-name\AppData\Local\github-copilot".

copilot.lua not working anymore

After 'PackerUpdate' copilot doesn't work anymore and I started to receive this error on my MacBook.
Had this issue only on MacBook but after 'PackerUpdate' - same on my Mac mini (but without warning, just doesn't show any completion as before)

[ERROR 02:01:28] async.lua:20: Error in coroutine: ...cker/start/packer.nvim/lua/packer/plugin_types/local.lua:53: E5560: vimL function must not be called in a lua loop callback

my config:

	{ "zbirenbaum/copilot.lua",
		event = { "vimenter" },
		config = function()
			vim.defer_fn(function()
				require("copilot").setup {
					plugin_manager_path = get_runtime_dir() .. "/site/pack/packer",
				}
			end, 100)
		end,
	},

	{ "zbirenbaum/copilot-cmp",
		after = {
			"copilot.lua",
			"nvim-cmp",
		},
	},

lvim.builtin.cmp.formatting.source_names["copilot"] = "(Copilot)"
table.insert(lvim.builtin.cmp.sources, 1, { name = "copilot" })

Everything was fine before. I use lunarvim

Current Goals

Now that I believe I have the copilot plugins in a stable state, here are the goals I have planned for the future:

  • Customization of result frequency: Currently, completions are requested by cmp which is debounced. I would like to add an option for constant requests for results via the uv loop api, similar to how copilot.vim gets their completions. Depending on the frequency you set, you may have dramatic increases in CPU usage and editor latency, but I do think this is worth implementing.
  • Extend the api, make it easier to use: This one is pretty self explanatory, hooking into copilot and adding your own functionality and handlers should be made much simpler. By virtue of how cmp works, it was easier to just make the buf requests there to get a functional product, but this will need to be implemented as part of goal (1). Development of this will likely precede or occur alongside goal (1)
  • Fix copilot adding extraneous braces, brackets, parenthesis, etc: If characters like closing braces or parenthesis exist, copilot will insert additional ones, which kinda sucks. This isn't going to be easy and is an issue in copilot.vim as well, but if it's done well, it would be a major step forward.
  • Creation of hosts/terms json files should be implemented as copilot.vim does

???: Provide your input! What else would you like to see? Please feel free to comment and discuss here, or create an issue with the enhancement/feature flags.

nil value on 'plugin_path'

im using LunarVim + nvim head branch, and get this message error at startup

Error executing vim.schedule lua callback: ...im/site/pack/packer/opt/copilot.lua/lua/copilot/util.lua:56: attempt to concatenate local 'plugin_path' (a nil value)
stack traceback:
        ...im/site/pack/packer/opt/copilot.lua/lua/copilot/util.lua:56: in function 'get_copilot_path'
        ...k/packer/opt/copilot.lua/lua/copilot/copilot_handler.lua:9: in function 'start'
        [string "..."]: in function ''
        vim/_editor.lua: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

so i replace my config following this solution because LunarVim things 😆, but still getting the same error message

  {
    "zbirenbaum/copilot.lua",
    event = "InsertEnter",
    config = function()
      vim.schedule(function
-        require("copilot").setup()
+       require("copilot.copilot_handler").start(vim.fn.expand "$HOME" .. "/.local/share/lunarvim/")
      end)
    end,
  },

I cant get it working. Please help

first of all, thanks for the plugin :)
I'm struggling to get it running. the copilot.vim plugin run though. The setup/auth is done.
I'm using LunarVim and Packer.
Here is my config:

-- {
--     "github/copilot.vim",
--     config = function ()
--         vim.g.copilot_no_tab_map = true
--     end
-- },
{
    "zbirenbaum/copilot.lua",
    event = {"VimEnter"},
    config = function ()
        vim.schedule(function ()
            require("copilot").setup {
                cmp = {
                    enabled = true,
                    method = "getPanelCompletions",
                },
                panel = { -- no config options yet
                    enabled = true,
                },
                ft_disable = { "markdown" },
                plugin_manager_path = vim.fn.expand "$HOME" .. "/.local/share/lunarvim/site/pack/packer",
            }
        end)
    end
},
{
    "zbirenbaum/copilot-cmp",
    module = "copilot_cmp"
},

...

vim.api.nvim_set_hl(0, "CmpItemKindCopilot", { fg = "#6CC644" })
lvim.builtin.cmp.formatting.format = function(entry, vim_item)
    local max_width = lvim.builtin.cmp.formatting.max_width
    if max_width ~= 0 and #vim_item.abbr > max_width then
        vim_item.abbr = string.sub(vim_item.abbr, 1, max_width - 1) .. ""
    end
    if lvim.use_icons then
        vim_item.kind = lvim.builtin.cmp.formatting.kind_icons[vim_item.kind]
    end
    if entry.source.name == "copilot" then
        vim_item.kind = "[] Copilot"
        vim_item.kind_hl_group = "CmpItemKindCopilot"
    end
    vim_item.menu = lvim.builtin.cmp.formatting.source_names[entry.source.name]
    vim_item.dup = lvim.builtin.cmp.formatting.duplicates[entry.source.name]
    or lvim.builtin.cmp.formatting.duplicates_default
    return vim_item
end
table.insert(lvim.builtin.cmp.sources, { name = "copilot", group_index = 2 })

Copilot not running without the official Copilot plugin

When I uninstall Topre's plugin and install copilot.lua and copilot-cmp by packer.nvim. I cannot run :CopilotAuth normallly. It reminds me "Copilot not running yet.". I have to add github/copilot.vim again to make it work.

lvim.plugins = {
  {
    "github/copilot.vim",
    config = function()
      vim.g.copilot_no_tab_map = true
      vim.g.copilot_assume_mapped = true
    end
  },
  {
    "hrsh7th/cmp-copilot",
    after = { "copilot.vim", "nvim-cmp" },
    config = function()
      lvim.builtin.cmp.formatting.source_names["copilot"] = "(Cop)"
      table.insert(lvim.builtin.cmp.sources, { name = "copilot" })
    end
  },
  {
    "zbirenbaum/copilot.lua",
    event = { "VimEnter" },
    config = function()
      vim.defer_fn(function()
        require("copilot").setup()
      end, 100)
    end,
  },

Not getting anything from copilot

Been using copilot for a while, and got no problem other than it would be nice to have a lua pluggin.
When I try to install yours i get nothing. I have the folder with two files in .config/github-copilot
Files are hosts and terms both json files

Before I install yours I made sure the folders where there, then I uninstalled copilot.
Reloaded vim added your pluggins, as described.

    "zbirenbaum/copilot.lua",
     event = "InsertEnter",
     config = function ()
       vim.schedule(function()
         require("copilot")
       end)
   end,
   },

  -- Copilot autocomplete
  -- Install after zbirenbaum copilot and load after nvim-cmp
   {
     'zbirenbaum/copilot-cmp',
     branch = "cycling_completions",
     after = {"copilot.lua", "nvim-cmp"},
   },

in my cmp for nvim cmp, I have it almost identical as yours, also because I did steal some from your config :P

local cmp = require 'cmp'
local luasnip = require 'luasnip'

require("luasnip/loaders/from_vscode").lazy_load()
cmp.setup({
  snippet = {
    expand = function(args)
      require("luasnip").lsp_expand(args.body)
    end,
  },
  style = {
    winhighlight = "NormalFloat:NormalFloat,FloatBorder:FloatBorder",
  },
  window = {
    completion = {
      border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" },
      scrollbar = "║",
      autocomplete = {
        require("cmp.types").cmp.TriggerEvent.InsertEnter,
        require("cmp.types").cmp.TriggerEvent.TextChanged,
      },
    },
    documentation = {
      border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" },
      winhighlight = "NormalFloat:NormalFloat,FloatBorder:FloatBorder",
      scrollbar = "║",
    },
  },
  mapping = {
    ["<PageUp>"] = function()
      for _ = 1, 10 do
        cmp.mapping.select_prev_item()(nil)
      end
    end,
    ["<PageDown>"] = function()
      for _ = 1, 10 do
        cmp.mapping.select_next_item()(nil)
      end
    end,
    ["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }),
    ["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }),
    ["<C-d>"] = cmp.mapping.scroll_docs(-4),
    ["<C-f>"] = cmp.mapping.scroll_docs(4),
    ["<C-Space>"] = cmp.mapping.complete(),
    ["<C-e>"] = cmp.mapping.close(),
    ["<CR>"] = cmp.mapping.confirm({
      behavior = cmp.ConfirmBehavior.Replace,
      select = false,
    }),
    ["<Tab>"] = function(fallback)
      if cmp.visible() then
        cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
      elseif luasnip.expand_or_jumpable() then
        luasnip.expand_or_jump()
      else
        fallback()
      end
    end,
    ["<S-Tab>"] = function(fallback)
      if cmp.visible() then
        cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select })
      elseif luasnip.jumpable(-1) then
        luasnip.jump(-1)
      else
        fallback()
      end
    end,
  },
  experimental = {
    native_menu = false,
    ghost_text = true,
  },
  sources = {
    -- { name = "copilot", group_index = 2 },
    { name = "nvim_lsp", group_index = 2 },
    { name = "path", group_index = 2 },
    { name = "luasnip", group_index = 2 },
    { name = "buffer", group_index = 5 },
    { name = "nvim_lua", group_index = 2 },
  },
  sorting = {
    comparators = {
      cmp.config.compare.recently_used,
      cmp.config.compare.offset,
      cmp.config.compare.score,
      cmp.config.compare.sort_text,
      cmp.config.compare.length,
      cmp.config.compare.order,
    },
  },
  preselect = cmp.PreselectMode.Item,
})

--set max height of items
vim.cmd([[ set pumheight=6 ]])
--set highlights
local highlights = {
  CmpItemKindText = { fg = "LightGrey" },
  CmpItemKindFunction = { fg = "#C586C0" },
  CmpItemKindClass = { fg = "Orange" },
  CmpItemKindKeyword = { fg = "#f90c71" },
  CmpItemKindSnippet = { fg = "#565c64" },
  CmpItemKindConstructor = { fg = "#ae43f0" },
  CmpItemKindVariable = { fg = "#9CDCFE", bg = "NONE" },
  CmpItemKindInterface = { fg = "#f90c71", bg = "NONE" },
  CmpItemKindFolder = { fg = "#2986cc" },
  CmpItemKindReference = { fg = "#922b21" },
  CmpItemKindMethod = { fg = "#C586C0" },
  CmpItemMenu = { fg = "#C586C0", bg = "#C586C0" },
  CmpItemAbbr = { fg = "#565c64", bg = "NONE" },
  CmpItemAbbrMatch = { fg = "#569CD6", bg = "NONE" },
  CmpItemAbbrMatchFuzzy = { fg = "#569CD6", bg = "NONE" },
}
vim.api.nvim_set_hl(0, "CmpBorderedWindow_FloatBorder", { fg = "#565c64" })
for group, hl in pairs(highlights) do
  vim.api.nvim_set_hl(0, group, hl)
end

If you need anyting more please let me know,
my nvim config is at: https://github.com/Gako358/Dotfiles/tree/a20b50ea6c4bad1c8ddc4e36383947c97234f1c9/.config/nvim

I have commented out your plugins and back using copilot.vim, until a solution is at place.
Any help when you got time is much appreciated.

Reminders for people how use `vim-plug` to install plugins.

plugin_manager_path should be the folder you store all your plugins, not "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/.

Instead you should put the path you stated in when you called vim-plug.
For example,

My plugins.lua:

vim.call('plug#begin', '~/.config/nvim/plugged')
...

My config file copilot.lua:

local status, copilot = pcall(require, "copilot")
if (not status) then return end

copilot.setup {
  cmp = {
    enabled = true,
    method = "getCompletionsCycling",
  },
  panel = { -- no config options yet
    enabled = true,
  },
  ft_disable = { "markdown", "terraform", "help" },
  plugin_manager_path = vim.env.HOME .. "/.config/nvim/plugged"
}

Copilot.lua + copilot-cmp not working

Hi! I just found out about copilot.lua and copilot-cmp on Reddit and installed them. I have the folder in ~/.config/github-copilot with both hosts.json and terms.json, but I'm not getting anything from copilot-cmp.

I already read #10 but nothing there was useful for me :(

Edit: I'm using neovim v0.7.0dev

This is all the config related to Copilot.lua and copilot-cmp, is an awful combination of configs since I've been trying for a couple of hours:

plugins.lua:

  use {
    "zbirenbaum/copilot.lua",
    event = { "VimEnter" },
    config = function()
      vim.defer_fn(function()
        require("copilot").setup({
          plugin_manager_path = vim.fn.stdpath("data") .. "/site/pack/packer",
          server_opts_overrides = {},
          ft_disable = { "markdown" }
        })
      end, 100)
    end,
  }
  use {
    "zbirenbaum/copilot-cmp",
    after = { "copilot.lua", "nvim-cmp" },
  }

cmp config:

local cmp = require("cmp")
cmp.setup{
  window = {
    completion = {
      border = { "", "", "", "", "", "", "", "" },
      scrollbar = "",
      autocomplete = {
        require("cmp.types").cmp.TriggerEvent.InsertEnter,
        require("cmp.types").cmp.TriggerEvent.TextChanged,
      },
    },
    documentation = {
      border = { "", "", "", "", "", "", "", "" },
      winhighlight = "NormalFloat:NormalFloat,FloatBorder:FloatBorder",
      scrollbar = "",
    },
  },
  config = {
    sources = {
      { name = 'copilot' }
    }
  },

  sources = {
    { name = "nvim_lsp", group_index = 2 },
    { name = "luasnip", group_index = 2 },
    { name = "cmp_tabnine", group_index = 2 },
    { name = "copilot", group_index = 2 },
    { name = "buffer", group_index = 2 },
  },
  formatting = {
    format = function(entry, vim_item)
      -- Kind icons
      vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
      -- Source
      vim_item.menu = ({
        buffer = "[Buffer]",
        nvim_lsp = "[LSP]",
        luasnip = "[LuaSnip]",
        copilot = "[Copilot]",
        cmp_tabnine = "[TabNine]"
      })[entry.source.name]
      return vim_item
    end
  },
  snippet = {
    expand = function(args)
      require("luasnip").lsp_expand(args.body)
    end,
  },
  enabled = function()
    -- disable completion in comments
    local context = require("cmp.config.context")
    return not context.in_treesitter_capture("comment") and not context.in_syntax_group("Comment")
  end,
  mapping = {
    ["<C-p>"] = cmp.mapping.select_prev_item(),
    ["<C-n>"] = cmp.mapping.select_next_item(),
    ["<C-d>"] = cmp.mapping.scroll_docs(-4),
    ["<C-f>"] = cmp.mapping.scroll_docs(4),
    ["<C-Space>"] = cmp.mapping.complete(),
    ["<C-e>"] = cmp.mapping.close(),
    ["<CR>"] = cmp.mapping.confirm({
      behavior = cmp.ConfirmBehavior.Replace,
      select = true,
    }),
    ["<Tab>"] = function(fallback)
      if cmp.visible() then
        cmp.select_next_item()
      elseif vim.fn["vsnip#available"](1) > 0 then
        -- handle vsnip
      else
        fallback()
      end
    end,
    ["<S-Tab>"] = function(fallback)
      if cmp.visible() then
        cmp.select_prev_item()
      elseif ls.jumpable(-1) then
        ls.jump(-1)
      else
        fallback()
      end
    end,
  },
}

Client x quit with exit code ...

Really like the idea to have copilot in cmp. But I keep getting the error message: 'Client 1 quit with exit code 1 and signal 0', whatever config setup I try. The regular copilot.vim plugin works fine. Any way I could debug this or get more verbose output of the error?

Latest version throws out copilot info

Upgrading the latest version, I notice that the following is output upon Copilot loading:

{
  editorConfiguration = {
    disabledLanguages = { ".", "cvs", "gitcommit", "gitrebase", "help", "hgcommit", "markdown", "svn", "yaml" },
    enableAutoCompletions = true
  },
  editorInfo = {
    name = "Neovim",
    version = "0.8.0 + Node.js 19.0.1"
  },
  editorPluginInfo = {
    name = "copilot.vim",
    version = "1.6.1"
  }
}

Reading both Copilot.vim and Copilot.nvim, I'm not sure how we disable this.

Error with Copilot starting

There seems to be an issue with the plugin after doing a :PackerSync aka updating the plugin.

:Copilot :

Error executing Lua callback: ...nvim/site/pack/packer/opt/copilot.lua/plugin/copilot.lua:15: attempt to concatenate local 'mod_name' (a nil value)                                                        
stack traceback:                                                                                                                                                                                           
        ...nvim/site/pack/packer/opt/copilot.lua/plugin/copilot.lua:15: in function <...nvim/site/pack/packer/opt/copilot.lua/plugin/copilot.lua:8> 

Reverting the update completely fixes the problem, but I am unsure why it even happens in the first place. Even though the error still shows up when executing :Copilot loads properly into cmp.

The only plugins active to test this are copilot.lua and copilot.cmp

  use {
    "zbirenbaum/copilot.lua",
    event = "InsertEnter",
    config = function ()
      vim.schedule(function()
        require("copilot").setup()
      end)
    end,
  }
  use {
    "zbirenbaum/copilot-cmp",
    after = { "copilot.lua" },
    config = function ()
      require("copilot_cmp").setup()
    end
  }

Important Announcement: Please Read Before Posting

I've pushed a number of sizable improvements and bug fixes to both copilot-cmp and copilot.lua. I've tentatively closed many of the issues in both repos regarding completions not showing in some locations, or showing inconsistently, as there were many that appeared to be duplicates and keeping track of what problems are outstanding was becoming difficult. I've tried to keep open the ones that look like they have causes which were not addressed by the changes. With that said, please regard the following:

Before anything else: Platform should no longer be a problem. I downloaded a 0.6 appimage to test and both copilot plugins functioned fine for me. If you have any issues, they should now be version independent. I apologize for the problems with attaching on 0.6, they were due to a problem I thought I had pushed the fix for days ago, and discovered I had not.

  1. If you have an open issue and the behavior of the problem has in no way changed, naturally please keep it open.
  2. If you had an issue closed and still run into the exact same problems, please re-open it.
  3. If you have an issue open which appears to be addressed, please close it
  4. If you have an issue (closed or open) and still are having problems after downloading the updates, but the nature of your problem seems to have changed, please do the following depending on your circumstance:
    4a. If you have an open issue: Close the current issue and open a new one with revised info
    4b. If you have a closed issue: Even if the behavior seems related, if it has changed in nature at all, please open a new issue and link the closed one as related.
  5. Before reopening any closed issue, or opening a new one, please check both copilot.lua and copilot-cmp for the same issue I understand if you cannot tell if someone is having the same problem as you, and in such cases, feel free to post, but taking a moment to do this will help a lot with organization

I promise if you have an existing problem I will work on it, but please try to adhere to the above for now.

[Windows] 'Spawning language server with cmd' error

When launching Neovim with Lunarvim config, I obtain this warning notification at startup:

Spawning language server with cmd: 'C:\nvim\data\lunarvim\site\pack\packer/opt/copilot.lua/index.js' failed with error message: UNKNOWN: unknown error

and no copilot suggestions are given when modifying a buffer.

OS: Windows 10 Pro

Neovim version:

NVIM v0.7.0-dev+1275-g00effff56
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilato da runneradmin@fv-az158-203

Features: -acl +iconv +tui
See ":help feature-compile"

   file vimrc di sistema: "$VIM\sysinit.vim"
         $VIM di riserva: "C:/Program Files/nvim/share/nvim"

Run :checkhealth for more info

packer.nvim config:

    {
      "zbirenbaum/copilot.lua",
      event = {"VimEnter"},
      after = "nvim-cmp",
      requires = {"zbirenbaum/copilot-cmp"},
      config = function()
        local cmp_source = { name = "copilot", group_index = 2 }
        table.insert(lvim.builtin.cmp.sources, cmp_source)
        vim.defer_fn(function()
          require("copilot").setup {
            plugin_manager_path = require("lvim.utils").join_paths(get_runtime_dir(), "site", "pack", "packer"),
          }
          end, 100)
      end,
    },

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.