add copilot

This commit is contained in:
fugotakefusa 2025-10-27 14:05:32 +13:00
parent 631d60d521
commit 89c8910845
1 changed files with 43 additions and 25 deletions

View File

@ -78,9 +78,7 @@ vim.o.scrolloff = 10
-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
-- instead raise a dialog asking if you wish to save the current file(s)
-- See `:help 'confirm'`
vim.o.confirm = true
-- [[ Basic Keymaps ]]
vim.o.confirm = true -- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()`
-- Clear highlights on search when pressing <Esc> in normal mode
@ -855,29 +853,49 @@ require('lazy').setup({
{ -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
-- Autoinstall languages that are not installed
auto_install = true,
highlight = {
enable = true,
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
-- If you are experiencing weird indenting issues, add the language to
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
additional_vim_regex_highlighting = { 'ruby' },
},
indent = { enable = true, disable = { 'ruby' } },
},
-- There are additional nvim-treesitter modules that you can use to interact
-- with nvim-treesitter. You should go explore a few and see what interests you:
--
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
config = function()
require('nvim-treesitter.configs').setup {
ensure_installed = { 'c', 'lua', 'vim', 'vimdoc', 'query' },
-- Autoinstall languages that are not installed
auto_install = true,
highlight = {
enable = true,
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
-- If you are experiencing weird indenting issues, add the language to
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
additional_vim_regex_highlighting = { 'ruby' },
},
indent = { enable = true, disable = { 'ruby' } },
incremental_selection = {
enable = true,
keymaps = {
init_selection = 'gnn', -- set to `false` to disable one of the mappings
node_incremental = 'grn',
scope_incremental = 'grc',
node_decremental = 'grm',
},
},
}
end,
},
{
'CopilotC-Nvim/CopilotChat.nvim',
dependencies = {
{
'zbirenbaum/copilot.lua',
cmd = 'Copilot',
event = 'InsertEnter',
config = function()
require('copilot').setup {}
end,
},
{ 'nvim-lua/plenary.nvim', branch = 'master' },
},
build = 'make tiktoken',
opts = {
-- See Configuration section for options
},
},
-- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the
-- init.lua. If you want these files, they are in the repository, so you can just download them and
-- place them in the correct locations.