Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Conversation

@SujitSakore
Copy link

This issue [CLI] Refact chat in Neovim #351 discusses the integration of chat functionality into Neovim by utilizing the existing code completion support provided in the Refact project. The proposed solution involves leveraging the toggleterm plugin to create a floating terminal for chat interactions. The implementation allows users to toggle the chat interface using a keyboard shortcut, enhancing the development experience by enabling context-aware communication directly within the IDE.

@olegklimov
Copy link
Contributor

Cool!

@olegklimov
Copy link
Contributor

I'll try it on the weekend!

@SujitSakore
Copy link
Author

Hello @olegklimov , could you please check and let me know if any changes are needed so I can work on them? I would also appreciate it if you could accept my pull request.

@olegklimov
Copy link
Contributor

Hi @SujitSakore !

image

I see there's lua code inside a python file, I'm confused :D

The other file, chat_with_at_command.py doesn't seem to be relevant at all, but it's used in the lua script, I'm confused again )

@SujitSakore
Copy link
Author

Hello, @olegklimov
I’ve integrated the toggleterm plugin into Neovim to create floating terminals for both the Refact tool and a simple Python-based chatbot. The setup involves defining two terminal instances—one for running the Refact command and another for executing a Python chat script. Specific keyboard shortcuts are assigned to toggle these terminals. For the Refact terminal, pressing Alt + e opens or closes a floating terminal running the refact . command. Similarly, the Python chat terminal can be toggled with Alt + c, where a simple chatbot script runs.

The Python chat script starts a basic conversation in the terminal, allowing messages to be typed and interacted with. Typing "exit" will end the chat session. This integration enables a seamless workflow between coding with Refact and interacting with the chatbot, all within Neovim’s terminal windows.

The init.lua file is used because Neovim supports Lua as its main configuration language, which is faster and more flexible. Lua is recommended for modern Neovim setups and plugins like toggleterm, making it easier to manage terminals, set key mappings, and configure plugins.

#351

@SujitSakore
Copy link
Author

Hello @olegklimov,
Could you please take a look at the changes I've made? Let me know if there’s anything that needs adjustment or further clarification.

@olegklimov olegklimov requested a review from MDario123 February 16, 2025 15:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants