From 3b423caee8e3d228f73c5115bafef1a0e28521d7 Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Mon, 1 Jan 2024 14:13:43 +0100 Subject: [PATCH] feat(nvim): add oatmeal plugin to use ollama directly in Neovim --- .dotbot.conf.yaml | 1 + Brewfile | 2 ++ nvim/lazy-lock.json | 1 + nvim/lua/plugins/oatmeal.lua | 11 +++++++++++ oatmeal/config.toml | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 47 insertions(+) create mode 100644 nvim/lua/plugins/oatmeal.lua create mode 100644 oatmeal/config.toml diff --git a/.dotbot.conf.yaml b/.dotbot.conf.yaml index 37041b7..6ed29d7 100644 --- a/.dotbot.conf.yaml +++ b/.dotbot.conf.yaml @@ -27,6 +27,7 @@ ~/.config/lazygit/config.yml: git/lazygit.yml ~/.config/lf: lf ~/.config/nvim: nvim + ~/.config/oatmeal: oatmeal ~/.config/ranger: ranger ~/.config/skhd: skhd ~/.config/starship.toml: prompt/starship.toml diff --git a/Brewfile b/Brewfile index 1329962..f0b1029 100644 --- a/Brewfile +++ b/Brewfile @@ -477,6 +477,8 @@ brew "charmbracelet/tap/vhs" brew "charmbracelet/tap/wishlist" # CLI tool for CookLang Recipe Markup Language brew "cooklang/tap/cook" +# Terminal UI to chat with large language models (LLM) using backends such as Ollama, and direct integrations with your favourite editor like Neovim! +brew "dustinblackman/tap/oatmeal" # prettier, on SPEED! brew "fsouza/prettierd/prettierd" # macOS command line utility to configure multi-display resolutions and arrangements. Essentially XRandR for macOS. diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 5e2c8c9..85d14f7 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -85,6 +85,7 @@ "nvim-ufo": { "branch": "main", "commit": "c6d88523f574024b788f1c3400c5d5b9bb1a0407" }, "nvim-various-textobjs": { "branch": "main", "commit": "8ebbedb58845d4bce91cfb1db705fb4e942ee333" }, "nvim-web-devicons": { "branch": "master", "commit": "43aa2ddf476012a2155f5f969ee55ab17174da7a" }, + "oatmeal.nvim": { "branch": "master", "commit": "efeca77819c136a4a93c8913f8d3601daf76abb4" }, "obsidian.nvim": { "branch": "main", "commit": "4a962b100a77f852207e9f0b8bc8e3564997a05f" }, "octo.nvim": { "branch": "master", "commit": "b5371003f209764c9d1cc43cf20b6dc52961f0e8" }, "oil.nvim": { "branch": "master", "commit": "523b61430cb7365f8f86609c2ea60e48456bac63" }, diff --git a/nvim/lua/plugins/oatmeal.lua b/nvim/lua/plugins/oatmeal.lua new file mode 100644 index 0000000..8a14c1c --- /dev/null +++ b/nvim/lua/plugins/oatmeal.lua @@ -0,0 +1,11 @@ +return { + "dustinblackman/oatmeal.nvim", + cmd = { "Oatmeal" }, + keys = { + { "om", mode = "n", desc = "Start Oatmeal session" }, + }, + opts = { + backend = "ollama", + model = "codellama:latest", + }, +} diff --git a/oatmeal/config.toml b/oatmeal/config.toml new file mode 100644 index 0000000..ee5352a --- /dev/null +++ b/oatmeal/config.toml @@ -0,0 +1,32 @@ +# The initial backend hosting a model to connect to. [possible values: langchain, ollama, openai] +backend = "ollama" + +# Time to wait in milliseconds before timing out when doing a healthcheck for a backend. +backend-health-check-timeout = 1000 + +# The editor to integrate with. [possible values: neovim, clipboard, none] +editor = "neovim" + +# The initial model on a backend to consume. Defaults to the first model available from the backend if not set. +model = "codellama:latest" + +# LangChain Serve API URL when using the LangChain backend. +lang-chain-url = "http://localhost:8000" + +# Ollama API URL when using the Ollama backend. +ollama-url = "http://localhost:11434" + +# OpenAI API token when using the OpenAI backend. +# open-ai-token = "" + +# OpenAI API URL when using the OpenAI backend. Can be swapped to a compatible proxy. +open-ai-url = "https://api.openai.com" + +# Sets code syntax highlighting theme. [possible values: base16-github, base16-monokai, base16-one-light, base16-onedark, base16-seti] +theme = "base16-onedark" + +# Absolute path to a TextMate tmTheme to use for code syntax highlighting. +# theme-file = "" + +# Your user name displayed in all chat bubbles. +# username = ""