Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,4 @@ gtags.files
eln-cache/
meghanada/
vimish-fold/
.gitconfig
42 changes: 42 additions & 0 deletions layers/+completion/minuet/README.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#+TITLE: minuet layer
# Document tags are separated with "|" char
# The example below contains 2 tags: "layer" and "web service"
# Avaliable tags are listed in <spacemacs_root>/.ci/spacedoc-cfg.edn
# under ":spacetools.spacedoc.config/valid-tags" section.
#+TAGS: layer|web service

# The maximum height of the logo should be 200 pixels.
[[img/minuet.png]]

# TOC links should be GitHub style anchors.
* Table of Contents :TOC_4_gh:noexport:
- [[#description][Description]]
- [[#features][Features:]]
- [[#install][Install]]
- [[#key-bindings][Key bindings]]

* Description
This layer adds support for something.

** Features:
- Autocomplete
- Lint
- Refactor
- ...

* Install
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
add =minuet= to the existing =dotspacemacs-configuration-layers= list in this
file.

* Key bindings

| Key Binding | Description |
|-------------+----------------|
| ~SPC x x x~ | Does thing01 |

# Use GitHub URLs if you wish to link a Spacemacs documentation file or its heading.
# Examples:
# [[https://github.com/syl20bnr/spacemacs/blob/develop/doc/VIMUSERS.org#sessions]]
# [[https://github.com/syl20bnr/spacemacs/blob/develop/layers/%2Bfun/emoji/README.org][Link to Emoji layer README.org]]
# If space-doc-mode is enabled, Spacemacs will open a local copy of the linked file.
3 changes: 3 additions & 0 deletions layers/+completion/minuet/config.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(spacemacs|defc minuet-provider-api-key ""
"The API Key literal value for the minuet-provider configured."
'string nil t)
10 changes: 10 additions & 0 deletions layers/+completion/minuet/keybindings.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(spacemacs/declare-prefix
"ai" "AI Completion - minuet"
"aic" "Configurations")

(spacemacs/set-leader-keys
"aii" 'minuet-show-suggestion
"aiI" 'minuet-complete-with-minibuffer
"aicp" 'minuet-configure-provider
"aiM" 'minuet-auto-suggestion-mode
)
30 changes: 30 additions & 0 deletions layers/+completion/minuet/packages.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
(defconst minuet-packages
'(
;; Get the package from MELPA, ELPA, etc.
(minuet :location (recipe
:fetcher github
:repo "golden0080/minuet-ai.el"
:branch "f1-multi-accept"))
(plz :location elpa)

(dash :location elpa)

(cl-lib :location elpa)

;; (minuet :location elpa)
))

(defun minuet/init-minuet ()
(use-package minuet
:config
(minuet-set-optional-options minuet-openai-fim-compatible-options :max_tokens 64)
(plist-put (symbol-value (intern (format "minuet-%s-options" minuet-provider))) :api-key (defun minuet--api-key () minuet-provider-api-key))

;; configure active mode keybindings
(define-key minuet-active-mode-map (kbd "C-j") 'minuet-next-suggestion)
(define-key minuet-active-mode-map (kbd "C-k") 'minuet-previous-suggestion)
(define-key minuet-active-mode-map (kbd "C-l") 'minuet-accept-suggestion-line-continue)
(define-key minuet-active-mode-map (kbd "TAB") 'minuet-accept-suggestion)
(define-key minuet-active-mode-map (kbd "C-h") 'minuet-dismiss-suggestion)
(define-key minuet-active-mode-map (kbd "C-g") 'minuet-dismiss-suggestion)
))