diff --git a/init.el b/init.el index a2cf73f..c53ec9d 100644 --- a/init.el +++ b/init.el @@ -629,13 +629,7 @@ directory. Otherwise, run `find-file' on that file." (setq default-input-method "japanese-mozc") (with-eval-after-load 'mozc (require 'mozc-posframe) - (defvar my/-mozc-mode-override-evil-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "C-k") #'mozc-handle-event) - map) - "Emulation map to override evil keys in `mozc-mode'.") - (add-to-list 'emulation-mode-map-alists - `((mozc-mode . ,my/-mozc-mode-override-evil-map)))) + (setq mozc-candidate-style 'posframe)) ;; mozc status bar stuff (defun my/-update-waybar-fcitx-state () @@ -865,6 +859,15 @@ With NO-EDGE, return nil if beg or end fall on the edge of the range." (advice-add 'sp-region-ok-p :around 'my/-evil-cp-region-ok-p-no-string) (advice-add 'evil-cp--balanced-block-p :around 'my/-evil-cp-block-ok-p-no-string)) +(with-eval-after-load 'mozc + (defvar my/-mozc-mode-override-evil-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "C-k") #'mozc-handle-event) + map) + "Emulation map to override evil keys in `mozc-mode'.") + (add-to-list 'emulation-mode-map-alists + `((mozc-mode . ,my/-mozc-mode-override-evil-map)))) + ;; better lisp editing (use-package adjust-parens :hook ((lisp-data-mode scheme-mode) . adjust-parens-mode) @@ -3838,6 +3841,38 @@ one of the normal rainbow-delimiters-depth-N-face faces." :config (keymap-unset auto-highlight-symbol-mode-map "C-x C-a" t)) +;; some AI stuff +(use-package minuet + :bind + (("M-y" . #'minuet-complete-with-minibuffer) + ("M-S-i" . #'minuet-show-suggestion) + ("C-c n" . #'minuet-configure-provider) + :map minuet-active-mode-map + ("M-p" . #'minuet-previous-suggestion) + ("C-k" . #'minuet-previous-suggestion) + ("M-a" . #'minuet-next-suggestion) + ("C-j" . #'minuet-next-suggestion) + ("M-A" . #'minuet-accept-suggestion) + ("C-M-i" . #'minuet-accept-suggestion) + ("RET" . #'minuet-accept-suggestion) + ("M-a" . #'minuet-accept-suggestion-line) + ("M-e" . #'minuet-dismiss-suggestion)) + :custom + (minuet-provider 'openai-fim-compatible) + (minuet-n-completions 1) + (minuet-context-window 512) + :config + (plist-put minuet-openai-fim-compatible-options + :end-point "http://localhost:11434/v1/completions") + (plist-put minuet-openai-fim-compatible-options + :name "Ollama") + (plist-put minuet-openai-fim-compatible-options + :api-key "TERM") + (plist-put minuet-openai-fim-compatible-options + :model "qwen2.5-coder:1.5b") + (minuet-set-optional-options minuet-openai-fim-compatible-options + :max-tokens 56)) + ;; Theme (doom-themes) (use-package doom-themes :config