An AI-powered code completion plugin for Emacs, based on crazywolf132’s Supermaven.el. This is a port of the official Supermaven Neovim plugin.
- Emacs 27.1 or later
- Internet connection
- Write access to user data directory (
/.local/shareor$XDG_DATA_HOME) - JSON support (included with Emacs 27.1+)
- Clone the repository:
git clone https://github.com/WuuBoLin/supermaven.el.git ~/.config/emacs/supermaven - Add to your Emacs configuration:
(add-to-list 'load-path "~/.config/emacs/supermaven") (require 'supermaven) (add-hook 'prog-mode-hook 'supermaven-mode)
(use-package supermaven
:ensure (:type git :host github :repo "WuuBoLin/supermaven.el")
:hook (prog-mode . supermaven-mode)
:config
(setq supermaven-auto-start t
supermaven-log-level 'info
supermaven-idle-delay 0.1)
:bind (:map supermaven-completion-map
("TAB" . supermaven-accept-completion)
("C-j" . supermaven-accept-completion-by-word)
("C-g" . supermaven-dismiss-completion)))Add to ~~/.doom.d/packages.el~:
(package! supermaven
:recipe (:host github :repo "WuuBoLin/supermaven.el"))Add to ~~/.doom.d/config.el~:
(use-package! supermaven
:hook (prog-mode . supermaven-mode))Run doom sync to install.
Add to your ~~/.spacemacs~ configuration:
(defun dotspacemacs/layers ()
(setq-default
dotspacemacs-additional-packages
'((supermaven :location (recipe :fetcher github
:repo "WuuBoLin/supermaven.el")))))
(defun dotspacemacs/user-config ()
(require 'supermaven)
(add-hook 'prog-mode-hook 'supermaven-mode))Enable Supermaven mode in programming buffers:
;; For all programming modes
(add-hook 'prog-mode-hook 'supermaven-mode)
;; Or enable globally
(supermaven-global-mode 1)| Key | Function | Description |
|---|---|---|
TAB | supermaven-accept-completion | Accept full completion |
C-j | supermaven-accept-completion-by-word | Accept next word |
C-g / ESC | supermaven-dismiss-completion | Dismiss completion |
C-c s r | supermaven-restart | Restart Supermaven process |
C-c s s | supermaven-status | Show process status |
M-x supermaven-start- Start the Supermaven processM-x supermaven-stop- Stop the Supermaven processM-x supermaven-restart- Restart the Supermaven processM-x supermaven-status- Show current process status
M-x supermaven-use-free- Switch to free tierM-x supermaven-use-pro- Switch to pro tier (requires activation)M-x supermaven-logout- Log out from Supermaven
M-x supermaven-show-log- Display log bufferM-x supermaven-toggle-log- Toggle log buffer visibilityM-x supermaven-clear-log- Clear log buffer
;; Completion trigger delay (seconds)
(setq supermaven-idle-delay 0.1)
;; File types to ignore
(setq supermaven-ignore-filetypes '("org" "txt" "md"))
;; Log level (off, error, warn, info, debug, trace)
(setq supermaven-log-level 'info)
;; Auto-start when mode is enabled
(setq supermaven-auto-start t)
;; Disable automatic completion (manual only)
(setq supermaven-idle-delay nil);; Custom completion triggers
(setq supermaven-completion-triggers '("." "(" "[" "{" " " ":" "=" ")"))
;; Minimum prefix length before triggering
(setq supermaven-minimum-prefix-length 2)
;; Maximum completion frequency (seconds between requests)
(setq supermaven-max-completion-frequency 0.5)
;; Custom predicates
(setq supermaven-enable-predicates '(supermaven--buffer-changed))
(setq supermaven-disable-predicates '(my-custom-disable-predicate))
;; Appearance customization
(setq supermaven-suggestion-face 'shadow)
(setq supermaven-suggestion-color "#666666");; Customize completion keybindings
(define-key supermaven-completion-map (kbd "C-<return>") #'supermaven-accept-completion)
(define-key supermaven-completion-map (kbd "M-<right>") #'supermaven-accept-completion-by-word)
(define-key supermaven-completion-map (kbd "C-c C-c") #'supermaven-dismiss-completion)- Check if supermaven-mode is enabled:
M-x supermaven-mode - Verify process status:
M-x supermaven-status - Check logs:
M-x supermaven-show-log - Ensure file type is not ignored in
supermaven-ignore-filetypes - Verify
supermaven-idle-delayis set to a positive number
- Check internet connection (required for binary download)
- Verify write permissions in data directory
- Try restarting:
M-x supermaven-restart - Check logs for specific error messages
[INFO] Supermaven service tier: Free- Service is running[ERROR] Failed to start Supermaven- Check binary download[WARN] Binary not found, downloading...- Initial setup[DEBUG] Completion request sent- Normal operation
If completions are too frequent or slow:
;; Increase delay
(setq supermaven-idle-delay 0.3)
;; Reduce frequency
(setq supermaven-max-completion-frequency 1.0)This project is licensed under the terms of the GNU General Public License version 3 (GPL-3.0). See the LICENSE file for details.
- @crazywolf132 for the initial Supermaven.el implementation
- Original Supermaven Neovim plugin developers
- Supermaven team for the AI completion service
- Emacs community for development resources
- GitHub Copilot Emacs implementation for architectural reference