add ollama

This commit is contained in:
Aditya 2024-03-10 13:03:17 +05:30
parent 2081f33ef8
commit 08f2906f82
Signed by: aditya
SSH key fingerprint: SHA256:jL1IvWsjjlPtw6HvDIHfXfhO9IkIokNEyIfuFhSdoyU
2 changed files with 42 additions and 0 deletions

View file

@ -36,6 +36,8 @@
./none-ls/none-ls.nix
./ollama/ollama.nix
./sets.nix
./snippets/luasnip.nix

40
config/ollama/ollama.nix Normal file
View file

@ -0,0 +1,40 @@
{
plugins.ollama = {
enable = true;
model = "tinyllama";
url = "http://127.0.0.11435";
};
keymaps = [
{
key = "<leader>o";
action = "<cmd>Ollama<cr>";
options = {
desc = "Ask Ollama";
};
}
{
mode = "v";
key = "<leader>oe";
action = "<cmd>Ollama Explain_Code<cr>";
options = {
desc = "Explain code snippet";
};
}
{
key = "<leader>oo";
action = "<cmd>Ollama Raw<cr>";
options = {
desc = "Ask Ollama";
};
}
{
mode = "v";
key = "<leader>os";
action = "<cmd>Ollama Simplify_Code<cr>";
options = {
desc = "Simplify code snippet";
};
}
];
}