diff --git a/.gitignore b/.gitignore index 2afc36c4e84d..7966abf67fc2 100644 --- a/.gitignore +++ b/.gitignore @@ -103,3 +103,4 @@ gtags.files eln-cache/ meghanada/ vimish-fold/ +.gitconfig \ No newline at end of file diff --git a/layers/+completion/minuet/README.org b/layers/+completion/minuet/README.org new file mode 100644 index 000000000000..4f72fe6104f2 --- /dev/null +++ b/layers/+completion/minuet/README.org @@ -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 /.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. diff --git a/layers/+completion/minuet/config.el b/layers/+completion/minuet/config.el new file mode 100644 index 000000000000..ef6c23f8c689 --- /dev/null +++ b/layers/+completion/minuet/config.el @@ -0,0 +1,3 @@ +(spacemacs|defc minuet-provider-api-key "" + "The API Key literal value for the minuet-provider configured." + 'string nil t) diff --git a/layers/+completion/minuet/keybindings.el b/layers/+completion/minuet/keybindings.el new file mode 100644 index 000000000000..48e5d6fed6f6 --- /dev/null +++ b/layers/+completion/minuet/keybindings.el @@ -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 + ) diff --git a/layers/+completion/minuet/packages.el b/layers/+completion/minuet/packages.el new file mode 100644 index 000000000000..8cb74d94ecca --- /dev/null +++ b/layers/+completion/minuet/packages.el @@ -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) + ))