English Version | 简体中文
Enjoy using Google Gemini in Emacs😀
- Have a Google account and access to Gemini
This package will not be uploaded to melpa, thanks for your understanding.
- Firstly, clone this repository
git clone https://github.com/AllTheLife/Gemini.el <path-to-site-lisp>
- Load the package in emacs
(add-to-list 'load-path "<path-to-gemini>")
(require 'gemini)
- You need to have your Google Gemini API token ready. You can get an API key via Google AI Studio.
(setq gemini-api-token "your api token")
- (optional) You may need to set up a proxy if you are not in a region or country Google Gemini allowed or in order to accelerate Google API request.
(setq gemini-http-proxy "http://localhost:port")
- Start gemini process
(gemini-start-process)
Et voilà 🎉
- Install Python dependencies:
pip install epc sexpdata google-generativeai
- Install markdown-mode
Note: Gemini currently has limited language support, so some commands cannot be implemented temporarily.
- Create a markdown file (
*.mk
or*.gemini
) and chat with Gemini usinggemini-chat
orgemini-chat-with-multiline
gemini-polish-document
polishes or fills in the content of the articlegemini-translate-into-chinese
Translate the passage into Chinese.gemini-translate-into-english
Translate the passage into English.
gemini-generate-code
generates code based on selected content or inputgemini-adjust-code
adjusts the code content based on inputgemini-explain-code
explains the code in the buffergemini-comment-code
adds comments to the code in the buffergemini-refactory-code
refactors the code in the buffergemini-generate-commit-message
insert the commit message
- Just
M-x gemini-choose-drafts
and jump to the draft you like!
Please use the command emacs -Q
and only add the gemini.el configuration to do a comparative test. If emacs -Q
can work normally, please check your personal configuration file.
If the problem still exists in the emacs -Q
environment, please go to here to submit an issue with the content of the *gemini*
window attached, which contains many clues to help us troubleshoot the problem.
As the developer is a high school student facing exam pressure, it is not guaranteed that bugs can be fixed in a timely manner, nor that pull requests can be accepted in a timely manner. Thank you for your understanding.
If there are any big shots willing to contribute some code, it will be greatly appreciated.
- Thanks to @manateelazycat for the beautiful code of mind-wave. Most of the code in this repository comes from here, which has greatly helped the development of this plugin.