Skip to content

Comments

llama.vim : add inst support for classic vim#106

Merged
ggerganov merged 4 commits intoggml-org:masterfrom
danbev:inst-classic-vim
Jan 31, 2026
Merged

llama.vim : add inst support for classic vim#106
ggerganov merged 4 commits intoggml-org:masterfrom
danbev:inst-classic-vim

Conversation

@danbev
Copy link
Member

@danbev danbev commented Jan 27, 2026

This commit add instruction support for classic vim. This differs a little from the neovim version but it works well enough this far.

After selecting a code block and entring an instruction command the will be a information ghost test specifying the number of tokens being generated, and after the generation is completed there will be a note saying:

16    ✅ Ready! Press <Tab> to accept.

Note sure if this is the optimal way but I've started using this and will iterate and improve as I go.

@ggerganov
Copy link
Member

Nice :)

@ggerganov
Copy link
Member

After accepting and then undoing does not work as expected - the text remains highlighted:

image

@danbev
Copy link
Member Author

danbev commented Jan 28, 2026

After accepting and then undoing does not work as expected - the text remains highlighted:

I'll take a look, I don't think I actually tried that.

This commit add instruction support for classic vim. This differs a
little from the neovim version but it works well enough this far.

After selecting a code block and entring an instruction command the will
be a information ghost test specifying the number of tokens being
generated, and after the generation is completed there will be a note
saying:
```
16    ✅ Ready! Press <Tab> to accept.
```

Note sure if this is the optimal way but I've started using this and
will iterate and improve as I go.
@danbev
Copy link
Member Author

danbev commented Jan 28, 2026

@ggerganov I think the undo should work now.

@danbev danbev marked this pull request as ready for review January 29, 2026 06:10
@danbev danbev changed the title llama.vim : add inst support for classic vim (wip) llama.vim : add inst support for classic vim Jan 29, 2026
@pnb
Copy link
Contributor

pnb commented Jan 30, 2026

I've tried this a bit and it works well so far, although I think my preferred FIM model (Qwen3 30B-A3B) doesn't like the inst prompt format very much. GLM 4.7-air does though! I will keep trying it out. This is a very nice feature, and I'm stuck in my classic vim ways at this point.

Edit: I'm curious if #109 will help Qwen once the branches are merged.

@ggerganov
Copy link
Member

Although I also still continue to use Qwen3 Coder 30B-A3B for FIM, I never actually tried to use the new instruct feature with it - directly went with gpt-oss-120b. My feeling is that both gpt-oss-120b and GLM-4.7-Flash would be significantly better for these instruct tasks compared to Qwen3 Coder 30B-A3B because they have reasoning.

@danbev
Copy link
Member Author

danbev commented Jan 30, 2026

I'm also using Qwen3 Coder 30B-A3B for FIM, and gpt-oss-20b-GGUF for the instruction model which seems to work well.

This commit removes the duplicate prop_remove calls that are currently
in the llama#inst_accept function. These calls are also done in the
s:inst_remove function.

The order of operations is also changed so that the inst_remove is
called before inst_callback. The reason for this is that in inst_callback
deletebufline is called the text properties are attached to the lines
that are being deleted. Later when vim restores (undo) the classic vim
will restore the deleted lines including the text properties. So the
text properties will come back unless they are removed before this.
By calling inst_remove first we are explicitly removing the text
properties first.
@ggerganov ggerganov merged commit a1c8e6e into ggml-org:master Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants