202504-04-0.mp4
(use-package relysium
:quelpa (relysium :fetcher github
:repo "bluzky/relysium"
:branch "main"
:files ("*.el"))
:hook (prog-mode . relysium-prog-mode))
(straight-use-package
'(relysium :type git
:host github
:repo "bluzky/relysium"
:branch "main"
:files ("*.el")))
(add-hook 'prog-mode-hook 'relysium-prog-mode)
-
Code generation from comments
- Fully implemented via
relysium-generate-from-comments
- Uses a clear pattern of "AI:" comment markers
- Fully implemented via
-
AI-powered code completion at cursor
- Implemented through
relysium-complete-cursor.el
- Context-aware with buffer understanding, extends code at current cursor position
- Implemented through
-
Code explanation capabilities
- Strong implementation via
relysium-ask.el
- Allows selecting code regions for specific questions
- Strong implementation via
-
In-chat code editing
- Core functionality via
relysium-edit.el
- Supports both region-based and cursor-position editing
- Core functionality via
-
Suggestion system
- Whole-file analysis and improvement via
relysium-suggest.el
- User-provided instructions for tailored suggestions
- Whole-file analysis and improvement via
- Mark code region or point cursor to line you want to make change
Ctrl-enter
to set direction.Enter
to submit request to LLM- On changes suggestion transient menu
Enter
to acceptx
to discard all suggestionsr
discard all suggestions and query again on same region
Commands • Reviewing Changes • Workflows • Editing • Completion • Generation • Suggestions • Questions
Relysium provides several ways to interact with AI models to improve your coding workflow. Here's how to use each feature:
Function | Key Binding | Description |
---|---|---|
relysium-edit-dwim |
C-<return> |
Smart contextual editing: edits selected region or completes at cursor |
relysium-ask |
C-c a |
Ask questions about selected code |
relysium-suggest |
C-c e s |
Get improvement suggestions for the entire buffer |
relysium-generate-from-comments |
C-c e g |
Generate code based on AI: comments |
relysium-complete-cursor |
C-c e p |
Complete code at the current cursor position |
relysium-buffer-toggle-window |
C-c e t |
Toggle the Relysium chat window |
relysium-buffer-clear |
C-c e c |
Clear the Relysium buffer |
relysium-buffer-add-context |
C-c e b |
Add region or buffer content to the Relysium buffer |
relysium-buffer-switch-to-chat |
C-c e w |
Switch to the chat buffer |
relysium-toggle-debug-mode |
C-c e D |
Toggle debug mode, showing debug logs |
relysium-debug-log |
C-c e d |
View the debug buffer |
relysium-transient-menu |
C-c e m |
Show the Relysium action menu |
When AI suggests changes, a transient menu will appear with these options:
Action | Key | Description |
---|---|---|
Next | n |
Navigate to the next change |
Prev | p |
Navigate to the previous change |
Accept | a |
Accept the current change and move to the next |
Reject | d |
Reject the current change and move to the next |
Accept all | RET |
Accept all changes and exit |
Discard all | x |
Discard all changes and exit |
Retry | r |
Discard changes and retry with modified query |
Quit | q |
Exit the transient menu |
- Select the code region you want to modify
- Press
C-<return>
(orM-x relysium-edit
) - Enter your instructions for how the code should be changed
- Review and accept/reject the suggested changes using the transient menu
- Position your cursor where you want code to be inserted
- Press
C-<return>
(orM-x relysium-complete-cursor
) - Enter a description of what code you want to generate
- Review and accept/reject the suggested code
- Add comments starting with
AI:
followed by your instructions# AI: Implement a function to calculate the factorial of a number
- Press
C-c e g
(orM-x relysium-generate-from-comments
) - The AI will replace these comments with actual code implementations
- Review and accept/reject the implementations
- Press
C-c e s
(orM-x relysium-suggest
) - Enter any specific instructions for the AI to consider
- The AI will analyze your entire file and suggest improvements
- Review and accept/reject the changes
- Select the code region you want to ask about
- Press
C-c a
(orM-x relysium-ask
) - Enter your question about the selected code
- View the AI's response in the chat window
- Backend: Relysium uses gptel as a backend. Ensure you have configured
gptel
appropriately. - Rate Limits: If using Claude, sending the entire buffer might hit rate limits. It's better to send only a region.
- Models: Claude 3-5 Sonnet seems to generate better code suggestions for this use case, though you can use other models supported by
gptel
.
1. Why don't you contribute to original package? This is my customization to fit my workflow. And it is a huge code changes. So I don't want to bother @lanceberge, because maybe the original version fit his workflow
Special thanks to @lanceberge for your original work on this package, and Claude AI which help me to actualize my ideas (Because I'm not good at Elisp :D)
2. Elysium is under GPL-3 license but your Relysium is under MIT license? I only learn the idea from Elysium and rewrite the whole things: the prompt, the diff algorithm, the buffer management, transient menu, logic to patch the changes. And also I want people to be free to make any changes.
Enjoy seamless code suggestions and management with Relysium!