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.txtfile (Or set the environment variable OPENAI_API_KEY.). - Install Python dependencies:
pip3 install openai epc sexpdata six. - Install markdown-mode
- Use
git cloneto download this repository and replace theload-pathpath 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.chatfile to automatically entermind-wave-chat-mode. - Execute the command
mind-wave-chat-ask(press Ctrl + j), input your question, and wait for ChatGPT to respond. - Execute the command
mind-wave-chat-continue(press Ctrl + u) to continue the conversation. - Execute the command
mind-wave-chat-generate-title(press Ctrl + i) to generate a new title based on the content.
If you want to change the topic, create a new *.chat file and continue asking ChatGPT questions.
There are two ways of inputting multi-line content:
- Execute the command
mind-wave-chat-ask-with-multiline(press Ctrl + Shift + j), input multiple questions, and wait for ChatGPT to respond. - Execute the command
mind-wave-chat-ask-insert-lineto insert the----- User ------separator, continue inputting multiple lines in the buffer, and finally executemind-wave-chat-ask-send-buffer.
Selected Content:
- Execute the command
mind-wave-translate-to-english, ChatGPT will automatically replace the selected area with the translated content. - Execute the command
mind-wave-proofreading-doc, ChatGPT will automatically replace the selected area with the polished document.
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.
- Open a video website and execute the command
mind-wave-summary-video. ChatGPT will automatically retrieve the video subtitles and analyze the summary of the video (YouTube Transcript API installation is required). - Open a text website and execute the command
mind-wave-summary-web. ChatGPT will automatically retrieve the core content of the webpage and analyze the summary of the webpage (nodejs-readability-cli installation is required).
Please use the command emacs -q and only add the mind-wave configuration for comparison testing. If emacs -q can work properly, please check your personal configuration file.
If the problem still exists in the emacs -q environment, please submit an issue and attach the contents of the *mind-wave* window to help us troubleshoot. There are many clues there that can help us investigate the problem.
- If you encounter a crash, please collect the crash information using the following steps:
- Install gdb and enable the option
(setq mind-wave-enable-debug t) - Use the command
mind-wave-restart-processto restart the MIND-WAVE process. - Send the contents of
*mind-wave*window when the next crash occurs.
- Install gdb and enable the option