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

copilot #3

Open
jmandel1027 opened this issue Dec 28, 2023 · 5 comments
Open

copilot #3

jmandel1027 opened this issue Dec 28, 2023 · 5 comments

Comments

@jmandel1027
Copy link

jmandel1027 commented Dec 28, 2023

Hey dude!

Love these tutorials, I went from "wtf eww lua" to "this is the way" I've been pushing myself to learn tmux and nvim for a while now, I had been fussing about with vimscript and pathogen but have since converted over.

Would love to see a copilot tutorial, I've been struggling with getting both github/copilot.vim and zbirenbaum/copilot.lua going. I suspect it has to do with the keymappings with cmp and im probably doing something really dumb lol. I think thats the last missing piece for me thats preventing me from leaving vscode behind as my main driver

@andresgutgon
Copy link

I have this in plugins/copilot.lua

return {
  {
    "github/copilot.vim",
    config = function()
      vim.g['copilot_assume_mapped '] = true
      vim.g['copilot_no_tab_map'] = true
      vim.g['copilot_tab_fallback '] = ""
    end
  }
}

@patrick91
Copy link

for me the basic configuration just works

return {
    {
        "github/copilot.vim",
    },
}

and make sure to run :Copilot setup :)

@jmandel1027
Copy link
Author

jmandel1027 commented Jan 1, 2024

Happy new year! thanks for circling back here.

I was able to get the copilot suggestions plugged in, but I'm still having trouble with the autocompletion and such. For some reason my bindings aren't allowing me to browse the suggestions and such or accept changes, I've tried a few things like listing imap and nmap bindings but still wrangling it on my end. probably just a noob issue and need to find out what keymaps/mode allow for access to that menu.

https://github.com/jmandel1027/dotfiles/blob/main/nvim/lua/plugins/completion.lua

@cjoke
Copy link

cjoke commented Jan 6, 2024

First I will thanks for all the youtube series and this repo! In addition to this configuration I also have installed copilot and copilotchat https://github.com/cjoke/neovim-for-cjoke/blob/main/lua/plugins/copilotchat.lua . Its a basic installation where I just have a :vsplit and the dialog goes through commandline :CopilotChat say what you want here, and you get the respond in a new buffer (that I chose to have in another window (vsplit) .

in copilot.lua I have

return {
  {
    "github/copilot.vim",
      config = function()
        vim.keymap.set('i', '<C-l>', 'copilot#Accept("<CR>")', {
          expr = true,
          replace_keycodes = false
        })
        vim.keymap.set('i', '<C-h>', '<Plug>(copilot-dismiss)')
        vim.keymap.set('i', '<C-k>', '<Plug>(copilot-next)')
        vim.keymap.set('i', '<C-j>', '<Plug>(copilot-previous)')
        vim.keymap.set('i', '<C-L>', '<Plug>(copilot-accept-word)')
        vim.g.copilot_no_tab_map = true
    end,
  },
}

and in vim-options.lua I have

-- Set up copilot config
vim.g.copilot_no_tab_maps = true
vim.g.copilot_disable_mappings = 1
vim.g.copilot_filetypes = {
	["*"] = false,
	["python"] = true,
	["c"] = true,
	["cpp"] = true,
  -- ["lua"] = true,
  -- markdown is needed for CopilotChat
  ["Markdown"] = true,
}

@kjvdven
Copy link

kjvdven commented Mar 4, 2024

There is also the alternative plugin

"zbirenbaum/copilot.lua"

This one is used in the Lazy distribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants