diff --git a/emacs/init.el b/emacs/init.el index c68dbce..24a62a5 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -7,6 +7,8 @@ (setq package-enable-at-startup t) (require 'use-package) +(setq auth-sources '("~/.authinfo.gpg")) + (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) @@ -58,10 +60,10 @@ (get-text-property 0 'org-hd-marker item))) (line (when marker (org-with-point-at marker - (buffer-substring (line-beginning-position) (line-end-position))))) + (buffer-substring (line-beginning-position) (line-end-position))))) (todo-keyword (when marker (org-with-point-at marker - (org-get-todo-state)))) + (org-get-todo-state)))) (truncated-line (when line (replace-regexp-in-string "^\\[#[A-Z]\\] " "" line)))) (if truncated-line @@ -137,26 +139,26 @@ (require 'server) (unless (server-running-p) (server-start)) (setq backup-by-copying t - completion-cycle-threshold 3 - create-lockfiles nil - custom-file (concat user-emacs-directory "custom.el") - delete-old-versions t - enable-recursive-minibuffers t - focus-follows-mouse t + completion-cycle-threshold 3 + create-lockfiles nil + custom-file (concat user-emacs-directory "custom.el") + delete-old-versions t + enable-recursive-minibuffers t + focus-follows-mouse t indent-tabs-mode nil - inhibit-startup-screen t - kept-new-versions 20 - kept-old-versions 2 - minibuffer-prompt-properties '(read-only t cursor-intangible t face minibuffer-prompt) - mouse-autoselect-window t - read-extended-command-predicate #'command-completion-default-include-p - read-process-output-max (* 1024 1024) - tab-always-indent 'complete + inhibit-startup-screen t + kept-new-versions 20 + kept-old-versions 2 + minibuffer-prompt-properties '(read-only t cursor-intangible t face minibuffer-prompt) + mouse-autoselect-window t + read-extended-command-predicate #'command-completion-default-include-p + read-process-output-max (* 1024 1024) + tab-always-indent 'complete tab-width 4 - text-mode-ispell-word-completion nil + text-mode-ispell-word-completion nil use-short-answers t - version-control t - warning-minimum-level :emergency + version-control t + warning-minimum-level :emergency backup-directory-alist `((".*" . ,(concat user-emacs-directory "backup"))) read-extended-command-predicate #'command-completion-default-include-p text-mode-ispell-word-completion nil @@ -210,9 +212,9 @@ (use-package multiple-cursors :ensure t :defer t :init (multiple-cursors-mode 1) :bind (("C-x C-<" . 'mc/edit-lines) - ("C->" . 'mc/mark-next-like-this) - ("C-<" . 'mc/mark-previous-like-this) - ("C-x C->" . 'mc/mark-all-like-this))) + ("C->" . 'mc/mark-next-like-this) + ("C-<" . 'mc/mark-previous-like-this) + ("C-x C->" . 'mc/mark-all-like-this))) ;; minibuffer ;; === @@ -303,13 +305,13 @@ ;; === (use-package magit :ensure t :defer t :bind (("C-x g g" . #'magit-status) - ("C-x g l l" . #'magit-log) - ("C-x g l a" . #'magit-log-all) - ("C-x g l f" . #'magit-log-buffer-file) - ("C-x g R s" . #'magit-reset-soft) - ("C-x g R h" . #'magit-reset-hard) - ("C-x g !" . #'magit-run) - ("C-x g b b" . #'magit-branch) + ("C-x g l l" . #'magit-log) + ("C-x g l a" . #'magit-log-all) + ("C-x g l f" . #'magit-log-buffer-file) + ("C-x g R s" . #'magit-reset-soft) + ("C-x g R h" . #'magit-reset-hard) + ("C-x g !" . #'magit-run) + ("C-x g b b" . #'magit-branch) ("C-x g b c" . #'magit-branch-create) ("C-x g b s" . #'magit-branch-checkout) ("C-x g m m" . #'magit-merge) @@ -317,7 +319,7 @@ :commands (magit-status-here magit-get-current-branch) :custom (magit-display-buffer-function - #'magit-display-buffer-same-window-except-diff-v1)) + #'magit-display-buffer-same-window-except-diff-v1)) ;; diagramming @@ -331,8 +333,8 @@ (use-package plantuml-mode :ensure t :config (setq plantuml-default-exec-mode 'jar - plantuml-jar-path "/usr/share/plantuml/plantuml.jar" - org-plantuml-jar-path (expand-file-name "/usr/share/plantuml/plantuml.jar")) + plantuml-jar-path "/usr/share/plantuml/plantuml.jar" + org-plantuml-jar-path (expand-file-name "/usr/share/plantuml/plantuml.jar")) (with-eval-after-load 'org (org-babel-do-load-languages 'org-babel-load-languages '((plantuml . t))))) @@ -357,8 +359,8 @@ (use-package kotlin-mode :ensure t :defer t) (use-package fic-mode :ensure t :defer t) (use-package flycheck :ensure t :defer t - :init - (global-flycheck-mode)) + :init + (global-flycheck-mode)) ;; navigation @@ -630,11 +632,11 @@ (interactive "p") (let ((filename (dired-get-filename))) (setq target (concat (file-name-sans-extension filename) - "-old" - (if (> arg 1) (number-to-string arg)) - (file-name-extension filename t))) + "-old" + (if (> arg 1) (number-to-string arg)) + (file-name-extension filename t))) (if (file-directory-p filename) - (copy-file filename target)) + (copy-file filename target)) ) ) @@ -700,32 +702,20 @@ (setq claude-shell-api-token (getenv "CLAUDE_API_KEY"))) +(use-package websocket :ensure t) (use-package org-ai :ensure t :commands (org-ai-mode org-ai-global-mode) :init - (add-hook 'org-mode-hook #'org-ai-mode) + (add-hook 'org-mode-hook #'org-ai-mode) (org-ai-global-mode nil) :config - (setq org-ai-default-provider 'anthropic) - (setq org-ai-default-chat-model "claude-3-opus-20240229") (setq org-ai-use-auth-source t) - (global-set-key (kbd "C-x O a") org-ai-global-prefix-map)) + (setq org-ai-default-provider 'anthropic) + (setq org-ai-default-chat-model "claude-3-5-sonnet-20240620") + (global-set-key (kbd "C-x O A") org-ai-global-prefix-map)) -;; setup key bindings -(setopt ellama-keymap-prefix "C-c e") -;; language you want ellama to translate to -(setopt ellama-language "English") -;; could be llm-openai for example -(require 'llm-ollama) -(setopt ellama-provider - (make-llm-ollama - ;; this model should be pulled to use it - ;; value should be the same as you print in terminal during pull - :chat-model "codellama:latest" - :embedding-model "nomic-embed-text" - :default-chat-non-standard-params '(("num_ctx" . 8192))))) (defun magit-reset-to-merge-base () "Reset to merge-base of two branches using Magit's branch selection."