English | 简体中文
mind-wave is an Emacs AI plugin developed using ChatGPT API, which can be deeply integrated into Emacs to improve its efficiency in various aspects.
As mind-wave is developed based on multithreading technology, ChatGPT will not block Emacs during calculation.
- Register OpenAI
- Obtain OpenAI API Key, and save the API Key to the
~/.emacs.d/mind-wave/chatgpt_api_key.txt
file (do not disclose the API Key to others). - Install Python dependencies:
pip3 install openai epc sexpdata six
. - Use
git clone
to download this repository and replace theload-path
path in the configuration below. - Add the following code to your configuration file
~/.emacs
:
(add-to-list 'load-path "<path-to-mind-wave>")
(require 'mind-wave)
- Create a
test.chat
file, which will automatically entermind-wave-chat-mode
. - Execute the command
mind-wave-chat-ask
(press Ctrl + j), enter the question, and wait for ChatGPT to answer.
If you want to change the topic, create a new *.chat
file and continue asking ChatGPT.
选中内容(请注意,不要选择太多,ChatGPT 的 API 有大小限制)
- 执行命令
mind-wave-translate-to-english
,ChatGPT 获得翻译后会自动替换选中区域的内容。 - 执行命令
mind-wave-proofreading-doc
,ChatGPT 会用润色后的文档自动替换选中区域的内容。
Move the cursor to the desired function for refactoring.
- Execute the command
mind-wave-refactory-code
, ChatGPT will automatically split the screen to display the refactored code and suggestions for improvement on the right. - Execute the command
mind-wave-comment-code
, ChatGPT will automatically split the screen to display code with comments on the right. - Execute the command
mind-wave-explain-code
, ChatGPT will automatically split the screen to display an explanation for the code on the right.