Compare commits
4 commits
c64cce44c8
...
b8d1c727a1
Author | SHA1 | Date | |
---|---|---|---|
b8d1c727a1 | |||
74e0f203bb | |||
a8622fd7d5 | |||
e187e15b85 |
3 changed files with 27 additions and 15 deletions
|
@ -22,10 +22,6 @@
|
||||||
url = "github:t4ccer/agenix.el";
|
url = "github:t4ccer/agenix.el";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
extra-package-chatgpt = {
|
|
||||||
url = "github:joshcho/ChatGPT.el";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
extra-package-copilot = {
|
extra-package-copilot = {
|
||||||
url = "github:zerolfx/copilot.el";
|
url = "github:zerolfx/copilot.el";
|
||||||
flake = false;
|
flake = false;
|
||||||
|
|
36
init.el
36
init.el
|
@ -48,7 +48,8 @@
|
||||||
(backup-directory-alist `(("." . ,temporary-file-directory)))
|
(backup-directory-alist `(("." . ,temporary-file-directory)))
|
||||||
(auto-save-files-name-transforms `((".*" ,temporary-file-directory t)))
|
(auto-save-files-name-transforms `((".*" ,temporary-file-directory t)))
|
||||||
(backup-by-copying t)
|
(backup-by-copying t)
|
||||||
(focus-follows-mouse 't)
|
(focus-follows-mouse t)
|
||||||
|
(mouse-autoselect-window t)
|
||||||
:config
|
:config
|
||||||
(set-face-background 'vertical-border (face-background 'default))
|
(set-face-background 'vertical-border (face-background 'default))
|
||||||
(set-display-table-slot standard-display-table 'vertical-border (make-glyph-code ?┃))
|
(set-display-table-slot standard-display-table 'vertical-border (make-glyph-code ?┃))
|
||||||
|
@ -464,7 +465,7 @@
|
||||||
(nix-ts-mode . (lambda ()
|
(nix-ts-mode . (lambda ()
|
||||||
(require 'eglot)
|
(require 'eglot)
|
||||||
(add-to-list 'eglot-server-programs
|
(add-to-list 'eglot-server-programs
|
||||||
'(nix-ts-mode . ("nil")))
|
'(nix-ts-mode . ("nixd")))
|
||||||
;; FIXME `nixd' completion not working, will give it a second try in the future
|
;; FIXME `nixd' completion not working, will give it a second try in the future
|
||||||
;; '(nix-ts-mode . ("nixd" :initializationOptions (:eval (:depth 10 :workers 4)
|
;; '(nix-ts-mode . ("nixd" :initializationOptions (:eval (:depth 10 :workers 4)
|
||||||
;; :formatting (:command "alejandra")
|
;; :formatting (:command "alejandra")
|
||||||
|
@ -793,14 +794,29 @@ This is meant to be an helper to be called from the window manager."
|
||||||
("C-c n l" . consult-org-roam-forward-links)
|
("C-c n l" . consult-org-roam-forward-links)
|
||||||
("C-c n r" . consult-org-roam-search))
|
("C-c n r" . consult-org-roam-search))
|
||||||
|
|
||||||
(use-package chatgpt
|
(use-package gptel
|
||||||
|
:custom
|
||||||
|
(gptel-api-key (getenv "OPENAI_API_KEY"))
|
||||||
:config
|
:config
|
||||||
(dolist (e '(("spiega" . "Spiega il seguente")
|
(defun ccr/suggest-eshell-command ()
|
||||||
("documenta" . "Documenta il seguente usando la sintassi appropriata in modo che possa essere inserito nel codice")
|
(interactive)
|
||||||
))
|
(save-excursion
|
||||||
(push e chatgpt-code-query-map))
|
(eshell-bol)
|
||||||
:bind
|
(let ((start-pos (point))
|
||||||
("C-c i" . chatgpt-query))
|
(end-pos (line-end-position)))
|
||||||
|
(gptel-request
|
||||||
|
(buffer-substring-no-properties start-pos end-pos) ;the prompt
|
||||||
|
:system "You are proficient with emacs shell (eshell), translate the following to something I could directly prompt to the shell. Your responses should only be code, without explanation or formatting."
|
||||||
|
:buffer (current-buffer)
|
||||||
|
:context (cons (set-marker (make-marker) start-pos)
|
||||||
|
(set-marker (make-marker) end-pos))
|
||||||
|
:callback
|
||||||
|
(lambda (response info)
|
||||||
|
(if (not response)
|
||||||
|
(message "ChatGPT response failed with: %s" (plist-get info :status))
|
||||||
|
(kill-region start-pos end-pos)
|
||||||
|
(insert response)))))))
|
||||||
|
)
|
||||||
|
|
||||||
(use-package copilot
|
(use-package copilot
|
||||||
:custom
|
:custom
|
||||||
|
@ -811,7 +827,7 @@ This is meant to be an helper to be called from the window manager."
|
||||||
|
|
||||||
(use-package pass
|
(use-package pass
|
||||||
:config
|
:config
|
||||||
(require 'password-store-otp) ;; FIXME use `use-pacakges' idiomatic way
|
(require 'password-store-otp) ;; FIXME use `use-pacakge' idiomatic way
|
||||||
|
|
||||||
:bind (("C-c p p" . password-store-copy)
|
:bind (("C-c p p" . password-store-copy)
|
||||||
("C-c p o" . password-store-otp-token-copy)
|
("C-c p o" . password-store-otp-token-copy)
|
||||||
|
|
|
@ -4,7 +4,6 @@ pkgs: epkgs: let
|
||||||
|
|
||||||
depsPerPackage = {
|
depsPerPackage = {
|
||||||
indent-bars = [elpaPackages.compat];
|
indent-bars = [elpaPackages.compat];
|
||||||
chatgpt = [melpaPackages.polymode];
|
|
||||||
copilot = [melpaPackages.editorconfig melpaPackages.dash melpaPackages.s melpaPackages.f];
|
copilot = [melpaPackages.editorconfig melpaPackages.dash melpaPackages.s melpaPackages.f];
|
||||||
notmuch-notify = [melpaPackages.alert melpaPackages.notmuch];
|
notmuch-notify = [melpaPackages.alert melpaPackages.notmuch];
|
||||||
};
|
};
|
||||||
|
@ -98,6 +97,7 @@ pkgs: epkgs: let
|
||||||
poly-org
|
poly-org
|
||||||
# casual
|
# casual
|
||||||
org-re-reveal
|
org-re-reveal
|
||||||
|
gptel
|
||||||
]) ++ (with elpaPackages; [
|
]) ++ (with elpaPackages; [
|
||||||
delight
|
delight
|
||||||
kind-icon
|
kind-icon
|
||||||
|
|
Reference in a new issue