implemented copilot integration as ghost text and simplified some
keyboard shortcuts
This commit is contained in:
@@ -4,7 +4,10 @@ return {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
|
||||
--{{{ Options
|
||||
opts = {
|
||||
--- {{{ Display
|
||||
display = {
|
||||
chat = {
|
||||
window = {
|
||||
@@ -24,17 +27,23 @@ return {
|
||||
}
|
||||
},
|
||||
},
|
||||
-- }}}
|
||||
--
|
||||
-- {{{ INTERACTIONS
|
||||
interactions = {
|
||||
chat = {
|
||||
adapter = "gemini_pro", -- Removed the curly braces
|
||||
adapter = "ollama_coder", -- Removed the curly braces
|
||||
},
|
||||
inline = {
|
||||
adapter = "ollama_coder", -- Removed the curly braces
|
||||
},
|
||||
background = {
|
||||
adapter = "ollama_bg", -- Pointed this to the new extended adapter string
|
||||
}
|
||||
},
|
||||
background = {
|
||||
adapter = "ollama_bg", -- Pointed this to the new extended adapter string
|
||||
},
|
||||
-- }}}
|
||||
--
|
||||
-- {{{ Adapters
|
||||
adapters = {
|
||||
http = {
|
||||
gemini_pro = function()
|
||||
@@ -81,5 +90,40 @@ return {
|
||||
end,
|
||||
},
|
||||
},
|
||||
-- }}}
|
||||
--
|
||||
-- {{{ Library
|
||||
prompt_library = {
|
||||
["Local Executor"] = {
|
||||
strategy = "chat",
|
||||
description = "Executes implementation diffs locally and writes TDD test cases.",
|
||||
opts = {
|
||||
adapter = "ollama_coder", -- Force it to use your local hardware
|
||||
is_default = false,
|
||||
is_slash_cmd = false,
|
||||
},
|
||||
prompts = {
|
||||
{
|
||||
role = "system",
|
||||
content = [[You are the Last Mile Executor.
|
||||
You run in a stateless context. I will provide you with a unified diff and a testing plan.
|
||||
Your strict execution order is:
|
||||
1. Output the test case file modifications first (SDET-first).
|
||||
2. Output the production implementation code modifications.
|
||||
|
||||
Do not write markdown headers (H1/H2). Use code blocks with the language ID.
|
||||
Precede every code block with a line comment specifying the exact 'filepath:'.
|
||||
Do not use bash syntax; adhere strictly to POSIX sh if writing shell automation.
|
||||
Do not execute terminal commands directly. Output the code blocks for manual unstaged review.]],
|
||||
},
|
||||
{
|
||||
role = "user",
|
||||
content = "I am ready to provide the Planner's diff. Await my input.",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- }}}
|
||||
}
|
||||
--}}}
|
||||
}
|
||||
|
||||
17
lua/plugins/copilot.lua
Normal file
17
lua/plugins/copilot.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
return {
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
cmd = "Copilot",
|
||||
event = "InsertEnter",
|
||||
opts = {
|
||||
suggestion = {
|
||||
enabled = false,
|
||||
-- debounce = 150,
|
||||
-- auto_trigger = true,
|
||||
-- keymap = { accept = "M-CR"}
|
||||
},
|
||||
panel = { enabled = false },
|
||||
},
|
||||
},
|
||||
{ "giuxtaposition/blink-cmp-copilot", dependencies = { "zbirenbaum/copilot.lua" } }
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
return {
|
||||
'NMAC427/guess-indent.nvim',
|
||||
config = function()
|
||||
require('guess-indent').setup ({
|
||||
filetype_exclude = {"lua"},
|
||||
})
|
||||
config = function()
|
||||
require('guess-indent').setup {
|
||||
auto_cmd = true, -- Set to false to disable automatic execution
|
||||
filetype_exclude = { 'netrw', 'tutor' }, -- A list of filetypes for which the auto command gets disabled
|
||||
buftype_exclude = { 'help', 'nofile', 'terminal', 'prompt' }, -- A list of buffer types for which the auto command gets disabled
|
||||
}
|
||||
end,
|
||||
} -- Detect tabstop and shiftwidth automatically
|
||||
|
||||
@@ -10,71 +10,99 @@ return { -- adds lsp functionality and api for included languages
|
||||
opts =
|
||||
{
|
||||
keymap = {
|
||||
preset = 'none',
|
||||
['<Down>'] = { 'select_next', 'fallback' },
|
||||
['<Up>'] = { 'select_prev', 'fallback' },
|
||||
['<Tab>'] = { 'accept', 'fallback' },
|
||||
['<C-space>'] = { 'show', 'show_documentation', 'hide_documentation' },
|
||||
preset = 'none',
|
||||
['<C-space>'] = { 'show', 'show_documentation', 'hide_documentation' },
|
||||
['<C-e>'] = { 'hide', 'fallback' },
|
||||
-- Use home-row modifications for navigation
|
||||
['<C-n>'] = { 'select_next', 'fallback' },
|
||||
['<C-p>'] = { 'select_prev', 'fallback' },
|
||||
-- A robust Tab behavior that accepts selections and jumps through snippets
|
||||
['<Tab>'] = {
|
||||
function(cmp)
|
||||
if cmp.is_visible() then return cmp.accept() end
|
||||
if cmp.snippet_active() then return cmp.snippet_forward() end
|
||||
end,
|
||||
'fallback'
|
||||
},
|
||||
['<S-Tab>'] = {
|
||||
function(cmp)
|
||||
if cmp.snippet_active() then return cmp.snippet_backward() end
|
||||
end,
|
||||
'fallback'
|
||||
},
|
||||
},
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
-- keymap = {
|
||||
-- preset = 'none',
|
||||
-- ['<Down>'] = { 'select_next', 'fallback' },
|
||||
-- ['<Up>'] = { 'select_prev', 'fallback' },
|
||||
-- ['<Tab>'] = { 'accept', 'fallback' },
|
||||
-- ['<C-space>'] = { 'show', 'show_documentation', 'hide_documentation' },
|
||||
-- },
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer', 'copilot' },
|
||||
providers = {
|
||||
copilot = { name = 'copilot', module = 'blink-cmp-copilot', score_offset = 100, async = true }
|
||||
},
|
||||
},
|
||||
completion = {
|
||||
ghost_text = { enabled = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
{
|
||||
'MeanderingProgrammer/render-markdown.nvim',
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.nvim' }, -- if you use the mini.nvim suite
|
||||
---@module 'render-markdown'
|
||||
},
|
||||
config = function()
|
||||
local lspconfig = require('lspconfig')
|
||||
-- Since you are using blink.cmp, extract its capabilities
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
},
|
||||
config = function()
|
||||
local lspconfig = require('lspconfig')
|
||||
-- Since you are using blink.cmp, extract its capabilities
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
|
||||
-- Configure OmniSharp for C# / nanoFramework development
|
||||
lspconfig.omnisharp.setup({
|
||||
capabilities = capabilities,
|
||||
cmd = { "omnisharp" },
|
||||
settings = {
|
||||
FormattingOptions = {
|
||||
EnableEditorConfigSupport = true,
|
||||
-- Configure OmniSharp for C# / nanoFramework development
|
||||
lspconfig.omnisharp.setup({
|
||||
capabilities = capabilities,
|
||||
cmd = { "omnisharp" },
|
||||
settings = {
|
||||
FormattingOptions = {
|
||||
EnableEditorConfigSupport = true,
|
||||
},
|
||||
MsBuild = {
|
||||
LoadProjectsOnDemand = false,
|
||||
},
|
||||
},
|
||||
MsBuild = {
|
||||
LoadProjectsOnDemand = false,
|
||||
},
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
local opts = { buffer = bufnr, remap = false }
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
||||
vim.keymap.set("n", "<leader>ca", function() vim.lsp.buf.code_action() end, opts)
|
||||
end,
|
||||
})
|
||||
end
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua", -- only load on lua files
|
||||
opts = {
|
||||
library = {
|
||||
-- Only load luvit types when the `vim.uv` word is found
|
||||
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||
-- always load the LazyVim library
|
||||
"LazyVim",
|
||||
-- Only load the lazyvim library when the `LazyVim` global is found
|
||||
{ path = "LazyVim", words = { "LazyVim" } },
|
||||
-- Load the wezterm types when the `wezterm` module is required
|
||||
-- Needs `DrKJeff16/wezterm-types` to be installed
|
||||
{ path = "wezterm-types", mods = { "wezterm" } },
|
||||
-- Load the xmake types when opening file named `xmake.lua`
|
||||
-- Needs `LelouchHe/xmake-luals-addon` to be installed
|
||||
{ path = "xmake-luals-addon/library", files = { "xmake.lua" } },
|
||||
on_attach = function(client, bufnr)
|
||||
local opts = { buffer = bufnr, remap = false }
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
||||
vim.keymap.set("n", "<leader>ca", function() vim.lsp.buf.code_action() end, opts)
|
||||
end,
|
||||
})
|
||||
end
|
||||
},
|
||||
-- disable when a .luarc.json file is found
|
||||
enabled = function(root_dir)
|
||||
return not vim.uv.fs_stat(root_dir .. "/.luarc.json")
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
{
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua", -- only load on lua files
|
||||
opts = {
|
||||
library = {
|
||||
-- Only load luvit types when the `vim.uv` word is found
|
||||
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||
-- always load the LazyVim library
|
||||
"LazyVim",
|
||||
-- Only load the lazyvim library when the `LazyVim` global is found
|
||||
{ path = "LazyVim", words = { "LazyVim" } },
|
||||
-- Load the wezterm types when the `wezterm` module is required
|
||||
-- Needs `DrKJeff16/wezterm-types` to be installed
|
||||
{ path = "wezterm-types", mods = { "wezterm" } },
|
||||
-- Load the xmake types when opening file named `xmake.lua`
|
||||
-- Needs `LelouchHe/xmake-luals-addon` to be installed
|
||||
{ path = "xmake-luals-addon/library", files = { "xmake.lua" } },
|
||||
},
|
||||
-- disable when a .luarc.json file is found
|
||||
enabled = function(root_dir)
|
||||
return not vim.uv.fs_stat(root_dir .. "/.luarc.json")
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
34
lua/plugins/neotest.lua
Normal file
34
lua/plugins/neotest.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
return {
|
||||
"nvim-neotest/neotest",
|
||||
dependencies = {
|
||||
"nvim-neotest/nvim-nio",
|
||||
"antoinemadec/FixCursorHold.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"nvim-neotest/neotest-python",
|
||||
"nvim-neotest/neotest-plenary",
|
||||
"rcarriga/neotest-vim-test",
|
||||
},
|
||||
config = function()
|
||||
local neotest = require("neotest")
|
||||
neotest.setup({
|
||||
adapters = {
|
||||
require("neotest-python")({
|
||||
dap = { justMyCode = false },
|
||||
runner = "pytest",
|
||||
python = ".venv/bin/python"
|
||||
}),
|
||||
require("neotest-plenary"),
|
||||
require("neotest-vim-test")({
|
||||
ignore_file_types = { "python", "vim", "lua" },
|
||||
}),
|
||||
},
|
||||
})
|
||||
vim.keymap.set('n', '<leader>tr' ,function() neotest.run.run() end ,{ desc = 'Neo[T]est [R]un' })
|
||||
vim.keymap.set('n', '<leader>tf' ,function() neotest.run.run(vim.fn.expand("%")) end ,{ desc = 'Neo[T]est Run [F]ile' })
|
||||
vim.keymap.set('n', '<leader>td' ,function() neotest.run.run({ strategy = "dap" }) end ,{ desc = 'Neo[T]est [D]ebug' })
|
||||
vim.keymap.set('n', '<leader>to' ,function() neotest.output_panel.toggle() end ,{ desc = 'Neo[T]est [O]utput Panel' })
|
||||
vim.keymap.set('n', '<leader>ts' ,function() neotest.summary.toggle() end ,{ desc = 'Neo[T]est [S]ummary Sidebar' })
|
||||
vim.keymap.set('n', ']t' ,function() neotest.jump.next({ status = 'failed' }) end,{ desc = 'Next Failed Test' })
|
||||
vim.keymap.set('n', '[t' ,function() neotest.jump.prev({ status = 'failed' }) end,{ desc = 'Prev Failed Test' })
|
||||
end,
|
||||
}
|
||||
Reference in New Issue
Block a user