Skip to content

Commit

Permalink
fix: help llms with :, /, or motion command
Browse files Browse the repository at this point in the history
Too often it would return something like an ex command without :
  • Loading branch information
3v0k4 committed Dec 19, 2024
1 parent 49de4a7 commit 2302392
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 15 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,34 @@ Once you know how to exit Vim, you can do more useful stuff:
<img alt="Demo: Delete all the lines that contain solved" src=".github/images/delete.gif" />
</div>

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.

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' })
```

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',
}
```

Expand All @@ -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',
}
```

Expand Down
7 changes: 4 additions & 3 deletions lua/anthropic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions lua/ollama.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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:
]]

Expand Down
7 changes: 4 additions & 3 deletions lua/openai.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2302392

Please sign in to comment.