From 23023921618508a83399f1ba952c9f2d34dfa04f Mon Sep 17 00:00:00 2001 From: 3v0k4 Date: Thu, 19 Dec 2024 09:07:00 +0100 Subject: [PATCH] fix: help llms with :, /, or motion command Too often it would return something like an ex command without : --- README.md | 16 +++++++++++----- lua/anthropic.lua | 7 ++++--- lua/ollama.lua | 8 ++++---- lua/openai.lua | 7 ++++--- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index d471667..276648e 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,12 @@ Once you know how to exit Vim, you can do more useful stuff: Demo: Delete all the lines that contain solved +Some more things you could ask: +- "move down 5 lines" +- "substitute foo with bar" +- "open a new vertical split" +- "make the current vertical split a horizontal split" + ## Installation It is suggested to use the latest release [tag](https://github.com/3v0k4/exit.nvim/tags) instead of main. @@ -24,13 +30,13 @@ It is suggested to use the latest release [tag](https://github.com/3v0k4/exit.nv Using [vim-plug](https://github.com/junegunn/vim-plug) ```viml -Plug '3v0k4/exit.nvim', { 'tag': '0.4.0' } +Plug '3v0k4/exit.nvim', { 'tag': '0.4.1' } ``` Using [dein](https://github.com/Shougo/dein.vim) ```viml -call dein#add('3v0k4/exit.nvim', { 'rev': '0.4.0' }) +call dein#add('3v0k4/exit.nvim', { 'rev': '0.4.1' }) " or , { 'rev': '0.4.x' }) ``` @@ -38,7 +44,7 @@ Using [packer.nvim](https://github.com/wbthomason/packer.nvim) ```lua use { - '3v0k4/exit.nvim', tag = '0.4.0', + '3v0k4/exit.nvim', tag = '0.4.1', } ``` @@ -47,12 +53,12 @@ Using [lazy.nvim](https://github.com/folke/lazy.nvim) ```lua -- init.lua: { - '3v0k4/exit.nvim', tag = '0.4.0', + '3v0k4/exit.nvim', tag = '0.4.1', } -- plugins/exit.lua: return { - '3v0k4/exit.nvim', tag = '0.4.0', + '3v0k4/exit.nvim', tag = '0.4.1', } ``` diff --git a/lua/anthropic.lua b/lua/anthropic.lua index c505290..4383938 100644 --- a/lua/anthropic.lua +++ b/lua/anthropic.lua @@ -9,9 +9,10 @@ Return only the command to be executed as a raw string, no string delimiters wrapping it, no yapping, no markdown, no fenced code blocks, what you return will be passed to vim directly. -For example, if the user asks: select abc - -You return only: /abc +For example: +- If the user asks: select abc, you return only: /abc +- If the user asks: replace x with y, you return only: :%s/x/y/g +- If the user asks: delete the next 5 lines, you return only: d4j ]] local function messages(prompt) diff --git a/lua/ollama.lua b/lua/ollama.lua index 3550f1e..16ab8bd 100644 --- a/lua/ollama.lua +++ b/lua/ollama.lua @@ -9,11 +9,11 @@ Return only the command to be executed as a raw string, no string delimiters wrapping it, no yapping, no markdown, no fenced code blocks, one line, what you return will be passed to vim directly. -Example 1: if the user asks: select abc +For example: +- If the user asks: select abc, you return only: /abc +- If the user asks: replace x with y, you return only: :%s/x/y/g +- If the user asks: delete the next 5 lines, you return only: d4j -You return only: /abc - -Example 2: If the user asks how to quit vim, you return: :q Here is the question: ]] diff --git a/lua/openai.lua b/lua/openai.lua index f9bcce0..68011b4 100644 --- a/lua/openai.lua +++ b/lua/openai.lua @@ -9,9 +9,10 @@ Return only the command to be executed as a raw string, no string delimiters wrapping it, no yapping, no markdown, no fenced code blocks, what you return will be passed to vim directly. -For example, if the user asks: select abc - -You return only: /abc +For example: +- If the user asks: select abc, you return only: /abc +- If the user asks: replace x with y, you return only: :%s/x/y/g +- If the user asks: delete the next 5 lines, you return only: d4j ]] local function messages(prompt)