feat: setup copilot

This commit is contained in:
buffet 2023-04-03 18:40:02 +02:00
parent 0e02daf29b
commit 7b6b1f9247
3 changed files with 54 additions and 3 deletions

View file

@ -53,6 +53,38 @@
"type": "github"
}
},
"copilot-cmp": {
"flake": false,
"locked": {
"lastModified": 1677432266,
"narHash": "sha256-Bu9Lx+1H1pG97ibwn8Q7jOHOKOrzg1nyucTTqbdlapI=",
"owner": "zbirenbaum",
"repo": "copilot-cmp",
"rev": "92535dfd9c430b49ca7d9a7da336c5db65826b65",
"type": "github"
},
"original": {
"owner": "zbirenbaum",
"repo": "copilot-cmp",
"type": "github"
}
},
"copilot-lua": {
"flake": false,
"locked": {
"lastModified": 1679135186,
"narHash": "sha256-ibp46ZQptwEqgaI03ANSbDV+lCaBe9uO0DkIAog8dgo=",
"owner": "zbirenbaum",
"repo": "copilot.lua",
"rev": "db62371b6eac73954c194f3c8faee36cffee8135",
"type": "github"
},
"original": {
"owner": "zbirenbaum",
"repo": "copilot.lua",
"type": "github"
}
},
"darwin": {
"inputs": {
"nixpkgs": [
@ -180,6 +212,8 @@
"agenix": "agenix",
"cmp-conventionalcommits": "cmp-conventionalcommits",
"cmp-git": "cmp-git",
"copilot-cmp": "copilot-cmp",
"copilot-lua": "copilot-lua",
"gh-nvim": "gh-nvim",
"home-manager": "home-manager",
"impermanence": "impermanence",

View file

@ -19,6 +19,16 @@
flake = false;
};
copilot-cmp = {
url = "github:zbirenbaum/copilot-cmp";
flake = false;
};
copilot-lua = {
url = "github:zbirenbaum/copilot.lua";
flake = false;
};
gh-nvim = {
url = "github:ldelossa/gh.nvim";
flake = false;

View file

@ -60,13 +60,20 @@
{
plugin = cmp-git;
config = "lua require 'cmp_git'.setup()";
config = "lua require 'cmp_git'.setup {}";
}
{
plugin = copilot-vim;
config = ''
let g:copilot_node_command = "${pkgs.nodejs-16_x}/bin/node"
'';
}
{
plugin = crates-nvim;
config = ''
lua require 'crates'.setup()
lua require 'crates'.setup {}
nnoremap <silent> ${leader}ct :lua require('crates').toggle()<cr>
nnoremap <silent> ${leader}cr :lua require('crates').reload()<cr>
@ -272,7 +279,7 @@
documentation = cmp.config.window.bordered(),
},
mapping = {
['<c-space>'] = cmp.mapping.confirm({ select = true }),
['<tab>'] = cmp.mapping.confirm({ select = true }),
['<c-p>'] = cmp.mapping.select_prev_item(select_opts),
['<c-n>'] = cmp.mapping.select_next_item(select_opts),
['<c-d>'] = cmp.mapping.scroll_docs(4),