mind-wave is an Emacs AI plug-in developed using the ChatGPT API, which can be deeply integrated into Emacs, thereby improving the work efficiency of Emacs in all aspects.

Since mind-wave is developed based on multi-threading technology, ChatGPT will not freeze Emacs during calculation.

Install

  1. registerOpenAI
  2. ObtainOpenAI API Keyand save the API Key to~/.emacs.d/mind-wave/chatgpt_api_key.txtfile (or set the environment variable OPENAI_API_KEY)
  3. Install Python dependencies:pip3 install openai epc sexpdata six
  4. Installmarkdown-mode
  5. usegit cloneDownload this repository and replace the following configuration withload-pathpath
  6. Add the following code to your config file~/.emacsmiddle:
(add-to-list 'load-path "<path-to-mind-wave>")
(require 'mind-wave)

use

dialogue mode

  1. new buildtest.chatfile, will automatically enter themind-wave-chat-mode
  2. Excuting an ordermind-wave-chat-ask(Press Ctrl+j), enter the question and wait for ChatGPT to answer
  3. Excuting an ordermind-wave-chat-continue(press Ctrl + u), continue answering
  4. Excuting an ordermind-wave-chat-generate-title(press Ctrl + i), regenerate the title according to the content

If you want to change the topic, create a new one*.chatfile, and then continue to ask questions to ChatGPT.

multiline input

There are two ways to enter multiple lines:

  1. Excuting an ordermind-wave-chat-ask-with-multiline(press Ctrl+Shift+j), type multi-line question and wait for ChatGPT to answer
  2. Excuting an ordermind-wave-chat-ask-insert-lineinsert----- User ------Separator, continue to enter multiple lines of content in Buffer, and finally executemind-wave-chat-ask-send-buffer

document mode

Select content (please note, don’t select too much, ChatGPT’s API has a size limit)

  1. Excuting an ordermind-wave-translate-to-englishChatGPT will automatically replace the content in the selected area after getting the translation.
  2. Excuting an ordermind-wave-proofreading-docChatGPT will automatically replace the content of the selected area with the polished document.
  3. Excuting an ordermind-wave-explain-wordChatGPT will automatically explain the meaning of the word in the current sentence and give similar example sentences.
  4. Excuting an ordermind-wave-adjust-textChatGPT adjusts the text or code according to your instructions
  5. Excuting an ordermind-wave-check-typosChatGPT fix typos

code pattern

Move the cursor to the function you want to refactor

  1. Excuting an ordermind-wave-generate-codeChatGPT will output the code in the current buffer according to the prompt
  2. Excuting an ordermind-wave-refactory-codeChatGPT will automatically split the screen, and the refactored code and refactoring suggestions are successively displayed on the right side of the screen
  3. Excuting an ordermind-wave-comment-codeChatGPT will automatically split the screen and display the annotated code on the right side of the screen
  4. Excuting an ordermind-wave-explain-codeChatGPT will automatically split the screen and display the code explanation on the right side of the screen
  5. Excuting an ordermind-wave-explain-pointChatGPT will automatically split the screen and display the explanation of the API at the cursor on the right side of the screen
  6. Excuting an ordermind-wave-generate-commit-nameChatGPT will automatically analyze the current diff content and generate a patch name
  7. Excuting an ordermind-wave-refactory-code-with-inputChatGPT will automatically split the screen, and according to your prompt, the refactored code and refactoring suggestions will be successively displayed on the right side of the screen

Code-related commands will automatically adjust the window layout, you can always usemind-wave-restore-window-configurationRestores the previous window layout.

summary mode

  1. Open the video website and execute the commandmind-wave-summary-videoChatGPT will automatically obtain video subtitles and analyze the video summary (need to installyoutube_transcript_api)
  2. Open the text website, execute the commandmind-wave-summary-webChatGPT will automatically obtain the core content of the webpage and analyze the summary of the webpage (need to installnodejs-readability-cli)

#mindwave #homepage #documentation #downloads #Emacs #plugin #based #ChatGPT #API #News Fast Delivery

Leave a Comment

Your email address will not be published. Required fields are marked *