AI-powered coding, seamlessly in Neovim
codecompanion.nvim is a productivity tool which streamlines how you develop with LLMs, in Neovim.
First, Navigate to the nvim configuration folder (default on Linux is ~/.config/nvim)
Then to the lua/plugins folder. Create a file named init.lua and add the following content:
return {
"olimorris/codecompanion.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
config = function()
require("codecompanion").setup({
adapters = {
deepseek = function()
return require("codecompanion.adapters").extend("deepseek", {
env = {
api_key = "YOUR_API_KEY",
},
})
end,
},
strategies = {
chat = { adapter = "deepseek", },
inline = { adapter = "deepseek" },
agent = { adapter = "deepseek" },
},
})
end
}
Restart nvim, and lazy.nvim should automatically download and install the codecompanion.nvim plugin and its dependencies based on the above file.
Add the following content to your init.lua:
local add, later = MiniDeps.add, MiniDeps.later
later(function()
add({
source = "olimorris/codecompanion.nvim",
depends = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
})
require("codecompanion").setup({
adapters = {
deepseek = function()
return require("codecompanion.adapters").extend("deepseek", {
env = {
api_key = "YOUR_API_KEY",
},
})
end,
},
strategies = {
chat = { adapter = "deepseek", },
inline = { adapter = "deepseek" },
agent = { adapter = "deepseek" },
},
})
end)
Restart nvim, and mini.deps should also automatically download and install the codecompanion.nvim plugin.