LLM coding mate for Neovim.
Ensure the tools listed below, are installed and accessible from Neovim' path.
Use your favorite package manager to install the plugin:
{
'silveiralexf/nvim-modelmate'
}
You can provide the following optional configuration table to the setup
function, for setting a different model on Ollama:
{
'silveiralexf/nvim-modelmate',
config = function()
require('nvim-modelmate').setup({
debug = false,
model = 'llama3:8b',
})
end,
}
use 'silveiralexf/nvim-modelmate'
Plug 'silveiralexf/nvim-modelmate'
You may set custom keybindings like this:
-- nvim/lua/config/keymaps.lua
-- Wrapper for vim.keymap.set function
local function map(mode, lhs, rhs, opts)
vim.keymap.set(mode, lhs, rhs, opts)
end
map('n', '\\m', '', { desc = 'ModelMate' })
map('n', '\\mo', '<cmd>ModelLlama<cr>', { desc = 'ModelLlama-chat' })
map('n', '\\mq', '<cmd>ModelQ<cr>', { desc = 'ModelQ-chat' })
map('n', '\\mg', '<cmd>ModelQgit<cr>', { desc = 'ModelQ-Git ask?' })
map('n', '\\mh', '<cmd>ModelQhist<cr>', { desc = 'ModelQ-History ask?' })
Use on of the following auto-commands for directly chatting in a new
Terminal
window where you can start chatting with your LLM.
Command | Description |
---|---|
:ModelLlama |
Creates a chat window to interact with Ollama |
:ModelQ |
Creates a chat window to interact with AmazonQ |
:ModelQhist |
Interact with AmazonQ with shell history context loaded |
:ModelQgit |
Interact with AmazonQ with current repository git contextual information loaded |
- To interact in the chat session, just enter insert mode with default binding,
<ESC> + i
. - To exit
Terminal
mode, which locks the focus within the buffer, use<CTRL> + \ <CTRL> + n
. - To end the session use
<CTRL> + c
.
A big shout-out to thank the amazing folks, from which I borrowed ideas (and code), for this plugin: