[nvim] Add git and cmp_ai
This commit is contained in:
8
.config/nvim/lua/plugins/git.lua
Normal file
8
.config/nvim/lua/plugins/git.lua
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"tpope/vim-fugitive"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"lewis6991/gitsigns.nvim"
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,34 +1,58 @@
|
|||||||
return {
|
return {
|
||||||
"hrsh7th/nvim-cmp",
|
{
|
||||||
dependencies = {
|
"tzachar/cmp-ai",
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
"hrsh7th/cmp-buffer",
|
config = function()
|
||||||
"hrsh7th/cmp-path",
|
local cmp_ai = require("cmp_ai.config")
|
||||||
"hrsh7th/cmp-cmdline",
|
cmp_ai:setup({
|
||||||
|
max_lines = 100,
|
||||||
|
provider = "Ollama",
|
||||||
|
provider_options = {
|
||||||
|
model = "codestral:latest",
|
||||||
|
auto_unload = false,
|
||||||
|
},
|
||||||
|
notify = true,
|
||||||
|
notify_callback = function(msg)
|
||||||
|
vim.notify(msg)
|
||||||
|
end,
|
||||||
|
run_on_every_keystroke = true,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
|
"hrsh7th/cmp-cmdline",
|
||||||
|
"tzachar/cmp-ai",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
vim.snippet.expand(args.body)
|
||||||
|
end
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
completion = cmp.config.window.bordered(),
|
||||||
|
documentation = cmp.config.window.bordered()
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||||
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
|
["<C-e>"] = cmp.mapping.abort(),
|
||||||
|
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "cmp_ai" },
|
||||||
|
},
|
||||||
|
{{ name = "buffer"}})
|
||||||
|
})
|
||||||
|
end
|
||||||
},
|
},
|
||||||
config = function()
|
|
||||||
local cmp = require("cmp")
|
|
||||||
cmp.setup({
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
vim.snippet.expand(args.body)
|
|
||||||
end
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
completion = cmp.config.window.bordered(),
|
|
||||||
documentation = cmp.config.window.bordered()
|
|
||||||
},
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
|
||||||
}),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = "nvim_lsp" },
|
|
||||||
},
|
|
||||||
{{ name = "buffer"}})
|
|
||||||
})
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user