From cf625b4009f0dfb90ac4683621c1598a379b1f96 Mon Sep 17 00:00:00 2001 From: JaeYoo-Im Date: Mon, 22 May 2023 17:41:15 +0900 Subject: [PATCH] 20230522-2 --- .config/emacs/.gitignore | 1 + .config/emacs/custom-default.el | 3 +++ .config/emacs/init.el | 1 + .config/emacs/lisp/init-base.el | 6 ++---- .config/emacs/lisp/init-chatgpt.el | 10 ++++++++++ .config/emacs/lisp/init-org.el | 6 +++--- .config/emacs/lisp/init-rust.el | 5 ++++- .config/emacs/lisp/init-ui.el | 3 +-- scripts/init_script_wsl.sh | 14 +++++++++++++- 9 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 .config/emacs/.gitignore create mode 100644 .config/emacs/lisp/init-chatgpt.el diff --git a/.config/emacs/.gitignore b/.config/emacs/.gitignore new file mode 100644 index 0000000..7ea8f90 --- /dev/null +++ b/.config/emacs/.gitignore @@ -0,0 +1 @@ +custom.el diff --git a/.config/emacs/custom-default.el b/.config/emacs/custom-default.el index c3876f8..f7a2be2 100644 --- a/.config/emacs/custom-default.el +++ b/.config/emacs/custom-default.el @@ -45,3 +45,6 @@ ;; Org setup (setq custom-org-directory "~/org" custom-org-agenda-files "~/org/agenda/agenda.org") + +;; Chatgpt setup +(setq custom-chatgpt-my-key "my-key") diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 1e88859..8ff514d 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -107,5 +107,6 @@ Otherwise the startup will be very slow. " (require 'init-verilog) (require 'init-extra) +(require 'init-chatgpt) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; init.el ends here diff --git a/.config/emacs/lisp/init-base.el b/.config/emacs/lisp/init-base.el index b408f0f..a001f40 100644 --- a/.config/emacs/lisp/init-base.el +++ b/.config/emacs/lisp/init-base.el @@ -123,10 +123,8 @@ (buf-label (aref val 3)) (tty (list (aref val 4) 'face 'font-lock-doc-face)) (thread (list (aref val 5) 'face 'font-lock-doc-face)) - (cmd (list (aref val (if emacs/>=27p 6 5)) 'face 'completions-annotations))) - (push (list p (if emacs/>=27p - (vector icon name pid status buf-label tty thread cmd) - (vector icon name pid status buf-label tty cmd))) + (cmd (list (aref val 6) 'face 'completions-annotations))) + (push (list p (vector icon name pid status buf-label tty thread cmd)) tabulated-list-entries))))) (advice-add #'list-processes--refresh :after #'my-list-processes--prettify))) diff --git a/.config/emacs/lisp/init-chatgpt.el b/.config/emacs/lisp/init-chatgpt.el new file mode 100644 index 0000000..2197527 --- /dev/null +++ b/.config/emacs/lisp/init-chatgpt.el @@ -0,0 +1,10 @@ +;; init-chatgpt.el -*- lexical-binding: t -*- +(use-package chatgpt-shell + :config + (setq chatgpt-shell-openai-key custom-chatgpt-my-key)) +(use-package dall-e-shell + :config + (setq dall-e-shell-openai-key custom-chatgpt-my-key)) + +(provide 'init-chatgpt) +;;; init-chatgpt.el ends here diff --git a/.config/emacs/lisp/init-org.el b/.config/emacs/lisp/init-org.el index 5541eed..d86336a 100644 --- a/.config/emacs/lisp/init-org.el +++ b/.config/emacs/lisp/init-org.el @@ -193,12 +193,13 @@ prepended to the element after the #+HEADER: tag." (defconst load-language-alist '((emacs-lisp . t) - (latex-as-png . t) (python . t) (ruby . t) (rust . t) (C . t)) "Alist of org ob languages.") + (unless ON-WINDOWS + (add-to-list 'load-language-alist '(latex-as-png . t))) (push '("conf-unix" . conf-unix) org-src-lang-modes) (add-to-list 'org-structure-template-alist '("sh" . "src shell")) @@ -222,7 +223,6 @@ prepended to the element after the #+HEADER: tag." :init (cl-pushnew '(rust . t) load-language-alist)) (org-babel-do-load-languages 'org-babel-load-languages load-language-alist) - ;; Auto-toggle Org LaTeX fragments (use-package org-fragtog :diminish @@ -318,6 +318,7 @@ prepended to the element after the #+HEADER: tag." ; org-roam ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (use-package org-roam :demand t ;; ensure org-roam is loaded by default + :hook (after-init . (my/org-roam-refresh-agenda-list)) :custom (org-roam-directory "~/org/roam") (org-roam-node-display-template (concat "${title:*} " (propertize "${tags:*}" 'face 'org-tag))) @@ -374,7 +375,6 @@ prepended to the element after the #+HEADER: tag." (unless org-note-abort (with-current-buffer (org-capture-get :buffer) (add-to-list 'org-agenda-files (buffer-file-name))))) - (my/org-roam-refresh-agenda-list) ; Tools ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (use-package ob-async :config diff --git a/.config/emacs/lisp/init-rust.el b/.config/emacs/lisp/init-rust.el index d212df8..5354314 100644 --- a/.config/emacs/lisp/init-rust.el +++ b/.config/emacs/lisp/init-rust.el @@ -31,7 +31,10 @@ ;;; Code: ;; Rust -(use-package rustic) +(use-package rustic + :init + (setq rustic-analyzer-command '("~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rust-analyzer")) + (setq rustic-lsp-client 'eglot)) (use-package rust-playground) (use-package toml-mode :defer t diff --git a/.config/emacs/lisp/init-ui.el b/.config/emacs/lisp/init-ui.el index 1328391..34de9d7 100644 --- a/.config/emacs/lisp/init-ui.el +++ b/.config/emacs/lisp/init-ui.el @@ -95,12 +95,11 @@ ;; Good pixel line scrolling (if (fboundp 'pixel-scroll-precision-mode) (pixel-scroll-precision-mode t) - (when (and emacs/>=27p (not sys/macp)) (use-package good-scroll :diminish :hook (after-init . good-scroll-mode) :bind (([remap next] . good-scroll-up-full-screen) - ([remap prior] . good-scroll-down-full-screen))))) + ([remap prior] . good-scroll-down-full-screen)))) ;; Smooth scrolling over images (use-package iscroll diff --git a/scripts/init_script_wsl.sh b/scripts/init_script_wsl.sh index 477b0e5..7f5c2b8 100755 --- a/scripts/init_script_wsl.sh +++ b/scripts/init_script_wsl.sh @@ -76,6 +76,19 @@ paru -S uctags-git --noconfirm # nov paru -S zip unzip --noconfirm +## +############################################################################### +# Programming Rust # +############################################################################### + +paru -S rustup --noconfirm + +rustup default stable + +rustup component add rust-analyzer +rustup component add rls +rustup component add rust-src + ################################################## # EXWM ################################################## @@ -86,4 +99,3 @@ paru -S xorg-xrandr feh cronie --noconfirm # Extra ################################################## paru -S bat -