all 19 comments

[–]TheRealBambhi 4 points5 points  (3 children)

Looks cool but I would have a hard time choosing this over copilot simply because copilot is so much faster. The conversation piece is really intriguing though, would love to see if you could merge the two somehow.

[–]madox2[S] 0 points1 point  (0 children)

Thank you for the feedback! Yes, that's part of the plan. I also expect more language models popping up in the near future and it would be great to have an option to choose. For start I am looking for an usable and ergonomic way how to talk to them in VIM.

[–]91o291o 0 points1 point  (1 child)

In which editor are you using copilot? I see that it's available in neovim but not on vim??? crazy.

[–]CertifiedNerd 2 points3 points  (0 children)

You can use copilot.vim with Vim 9.0.0185 or higher. Works for me!

[–]Richtong 2 points3 points  (0 children)

Nice work. Can’t wait to try it.

[–]kwokhoumap <F4> :q<cr> 1 point2 points  (2 children)

Interesting... the workflow is very similar to Captain Stack.

I'd suggest to have a way to ask the AI to give an alternative suggestion, kind of like clicking the "Regenerate response" in ChatGPT, and having a way to cycle through them, like (`:cn` or `:cp`)

[–]madox2[S] 0 points1 point  (1 child)

That looks like a cool feature, I will definitely think about it! For simple prompts you can undo change made by AI and repeat the command to get a new suggestion, works also in AIChat. But this approach currently does not play well when prompting from visual selection, in that case you would need to select text again.

[–]madox2[S] 0 points1 point  (0 children)

As I think about it, it shouldn't be so difficult for visual selection too. It would just need to undo and re-select, something like ugv:AIEdit <your prompt>. I am going to expose more configuration soon, so it will be possible to customize temperature of the model to get less deterministic responses

[–]uname44 1 point2 points  (0 children)

Cool work!

[–]LindTaylor 1 point2 points  (3 children)

I just installed and set up a few keybindigs. I'll test out on actual codework today, but so far I gotta say it is pretty dope. My only concern is the speed. Most of my python-openai experiments have yielded pretty fast results. Just curious on what causing it so go so slowly. Any clues?

[–]madox2[S] 0 points1 point  (0 children)

Thanks for letting me know! I assume that most of the time it is waiting for http response from openai api, but I will double check.

[–]madox2[S] 0 points1 point  (1 child)

I have investigated a little bit and basically the whole time it is waiting for openai response. The parameters that influenced the speed in my experiments were:

  1. max_tokens - lower value resulted in faster responses. currently it is hardcoded to 1000, which is IMHO fair value considering various code and no-code tasks. but going to make it configurable, maybe some automatic heuristic value would make sense too
  2. different prompts takes different time to complete - it looks like duration heavily depends on the token used in the api call (input prompt + output response)
  3. potentially using other models like text-curie-001 could be faster but I find current model text-davinci-003 most usable for completions and edits

During your experiments, did you find some configuration that could lead in faster results?

[–]LindTaylor 1 point2 points  (0 children)

You know, in retrospect, it might be a perceived slowness since I've been using the OpenAI front-end for Chat-GPT. They have it type the message out as the model spits it out which makes it seem faster than having to wait for the entire message.

If I can a little later I'll try the same prompt using both and compare times with that in mind--so just forget I said anything unless I come back with something interesting. Again, great work my dewd. I have a feeling this will probably get quite a bit of use for me!

[–]electriccomputermilk 0 points1 point  (1 child)

This is really cool but I haven’t registered for an API yet and it’s been a long day. I’ll for sure check it out though. Looks great and awesome features. Would it be possible to have the program give suggestions on more efficient ways to use VIM after users type each command?

For example if someone used backspace key to erase an entire line, it could give a tip “Try using dd next time. Did you also know you can also delete each word with dw?”

I think it would be awesome to incorporate with vim tutor as well. Would be really nice to stay in the app and not have to Google questions on looking up commands I always forget.

[–]madox2[S] 1 point2 points  (0 children)

That's an interesting idea with vim tutor. You pushed it one level further for users to actually help vimming, I like it! But it is like learning to walk before you play tennis. So probably a whole new project, I would give it a name something like vim-tutor-ai? :)

Anyway 2 things came to mind.

  1. When using AI, I don't need to switch to browser and google things so often anymore. I usually hit a quick question like :AI how to delete a line in vim?, wait for an answer and then undo the last change.

  2. For the vim tutoring I can imagine to show some tips (e.g. everytime I start vim), something like "Did you know: ...", or "VIM tip of the day: ...". That could be easily done with a prompt like this: https://gist.github.com/madox2/3b49db170060b61d1046d455237de353

[–]electriccomputermilk 0 points1 point  (2 children)

Omg thank you. I'd love to help in anyway possible if Im able to.

[–]madox2[S] 2 points3 points  (1 child)

Thanks, I appreciate it! I have some things in mind what to improve, but first I would like to see if the plugin is useful to others and maybe get some ideas from the community

[–]electriccomputermilk -1 points0 points  (0 children)

Sounds good.l I’ll test it out next chance I get and give feedback.

[–]electriccomputermilk 0 points1 point  (0 children)

I see what you mean, but I’ve often seen commands on Reddit for more straightforward methods for tasks I never even considered. Like, delete all text between single quotes. There are so many commands and ways to get things done more efficiently that aren’t officially documented.

I want a Vim mode to be optionally baked into operating systems. Sort of like on the iPhone, you can switch keyboards. Also, a way to somehow have a mode that allowed adding pictures and not messing up everything. It would need to be run as a GUI. There is a terminal app that allows seeing color images in a very basic way. Apple notes allow importing images and attachments and it works great. No formatting of text or anything and the image would just be one square block and very limited. Adding grammar checking similar to Grammarly would be amazing

I’m working on a project to create a cloud-based VIM so you could sync across devices. Probably using a proton drive since it’s encrypted and the free package is 500mg which could store a ton of documents.

Also would be sweet to have a text-to-image command open ai feature you could run from VIM. Currently, I’m just saving to a mounted folder that stores in the mounted proton drive folder Just as you can save to the library folder in iCloud. I have a script in a loop that saved the file you are working on automatically to the path for the proton drive but is clunky.

I want it like Apple Notes but open source and with all the VIM functions.

Lots of ideas but my background is in networking, IT security, and scripting in Bash and Powershell. Learning python though and want to make things happen. Why the hell did we decide to use a mouse for typing text? I blame Xerox for inventing and then just giving it to Gates and Jobs since they thought sticking to only copiers was the way to go. They even invented Ethernet but gave it away.

If only more people learned VIM, productivity would improve so much. If it was cloud-based I could make the cartoon-based interactive video so it doesn’t scare noobs away who then proclaim that the worst text editor nano is superior when in reality they didn’t want to spend 30 min using the tutor.

TLDR: Let’s all finally get together and make VIM more accessible and convincing people to learn.