addet a important keympap <C-s> and also addet ai cmp (but idk if it works..)
This commit is contained in:
parent
31a0f94839
commit
a0a00abfc5
2 changed files with 133 additions and 72 deletions
|
@ -53,6 +53,7 @@ map("n", "<leader>k", "<C-w><C-k>", { desc = "Move focus to the upper window" })
|
|||
-- map("n", "<leader>p", vim.cmd.Ex)
|
||||
map("n", "<leader>q", vim.cmd.q)
|
||||
map("n", "<leader>s", vim.cmd.w)
|
||||
map("n", "<C-s>", vim.cmd.w)
|
||||
|
||||
-- ─< rename word under cursor >───────────────────────────────────────────────────────────
|
||||
map("n", "<leader>R", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
return {
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
|
@ -32,6 +33,17 @@ return {
|
|||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
-- ["<C-x>"] = cmp.mapping({
|
||||
-- cmp.mapping.complete({
|
||||
-- config = {
|
||||
-- sources = cmp.config.sources({
|
||||
-- { name = "cmp_ai" },
|
||||
-- }),
|
||||
-- },
|
||||
-- }),
|
||||
-- { "i" },
|
||||
-- }),
|
||||
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
|
||||
["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
|
@ -57,6 +69,7 @@ return {
|
|||
{ name = "luasnip" }, -- snippets
|
||||
{ name = "buffer" }, -- text within current buffer
|
||||
{ name = "path" }, -- file system paths
|
||||
{ name = "cmp_ai" }, -- AI completion
|
||||
}),
|
||||
-- configure lspkind for vs-code like pictograms in completion menu
|
||||
formatting = {
|
||||
|
@ -76,4 +89,51 @@ return {
|
|||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
-- ─< for ai use >──────────────────────────────────────────────────────────────────────
|
||||
"tzachar/cmp-ai",
|
||||
dependencies = {
|
||||
"hrsh7th/nvim-cmp",
|
||||
"tzachar/cmp-ai",
|
||||
},
|
||||
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local cmp_ai = require("cmp_ai.config")
|
||||
|
||||
-- Setup cmp-ai configuration
|
||||
cmp_ai:setup({
|
||||
max_lines = 100,
|
||||
provider = "Ollama",
|
||||
-- provider_options = {
|
||||
-- model = "codellama:7b-code",
|
||||
-- auto_unload = false,
|
||||
-- raw_response_cb = function(response)
|
||||
-- vim.notify(vim.inspect(response))
|
||||
-- vim.g.ai_raw_response = response
|
||||
-- end,
|
||||
-- },
|
||||
provider_options = {
|
||||
model = "qwen2.5-coder:7b-base-q6_K",
|
||||
prompt = function(lines_before, lines_after)
|
||||
return "<|fim_prefix|>" .. lines_before .. "<|fim_suffix|>" .. lines_after .. "<|fim_middle|>"
|
||||
end,
|
||||
raw_response_cb = function(response)
|
||||
vim.notify(vim.inspect(response))
|
||||
vim.g.ai_raw_response = response
|
||||
end,
|
||||
},
|
||||
notify = true,
|
||||
notify_callback = function(msg)
|
||||
vim.notify(msg)
|
||||
end,
|
||||
run_on_every_keystroke = true,
|
||||
ignored_file_types = {
|
||||
txt = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue