This commit is contained in:
Levi Neely 2024-09-10 15:54:05 +02:00
parent 51f6dec521
commit 2155ab166b
2 changed files with 72 additions and 70 deletions

View File

@ -66,10 +66,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
@ -94,7 +94,7 @@
"Setup personal 'org-mode' configuration."
(setq org-agenda-inhibit-startup t
org-adapt-indentation nil
org-todo-keywords '((sequence "HOLD(h)" "TODO(t)" "|"
org-todo-keywords '((sequence "HOLD(h)" "TODO(t)" "WAIT(w)" "|"
"DONE(d)" "CNCL(x)"))
org-todo-keyword-faces
'(("HOLD" . (:foreground "orange" :weight bold))
@ -160,26 +160,26 @@
(setq tramp-inline-compress-start-size 1000)
(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
@ -233,9 +233,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
;; ===
@ -297,7 +297,7 @@
("C-x n l f" . #'denote-find-link)
("C-x n b l" . #'denote-backlinks)
("C-x n b f" . #'denote-find-backlink)
("C-x n /" . #'my/search-denote-notes)
("C-x n /" . #'my/search-denote-notes)
("C-x n r r" . #'denote-rename-file)
("C-x n r f" . #'denote-rename-file-using-front-matter))
@ -321,7 +321,7 @@
denote-infer-keywords t
denote-sort-keywords t
denote-file-type nil
denote-history-completion-in-prompts nil
denote-history-completion-in-prompts nil
denote-prompts '(title keywords)
denote-excluded-directories-regexp nil
denote-excluded-keywords-regexp nil
@ -336,24 +336,24 @@
;; ===
(use-package magit :ensure t :defer t
:commands (magit-status-here
magit-get-current-branch
magit-get-upstream-branch
magit-read-branch
magit-git-string
magit-get-current-branch
magit-get-upstream-branch
magit-read-branch
magit-git-string
magit-reset-to-merge-base
magit-reset-to-upstream)
:custom (magit-display-buffer-function
#'magit-display-buffer-same-window-except-diff-v1)
#'magit-display-buffer-same-window-except-diff-v1)
:bind (("C-x g g" . #'magit-status)
("C-x g r b" . #'magit-reset-to-merge-base)
("C-x g r u" . #'magit-reset-to-upstream)
("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)
@ -361,31 +361,31 @@
:config
(defun magit-reset-to-merge-base ()
"Reset to merge-base of two branches using Magit's branch selection."
(interactive)
(require 'magit)
(let* ((branch1 (magit-read-branch "Select first branch: "))
(branch2 (magit-read-branch "Select second branch: "))
(merge-base (magit-git-string "merge-base" branch1 branch2)))
(if merge-base
(progn
(magit-reset-internal "--soft" merge-base)
(message "Reset to merge-base of %s and %s" branch1 branch2))
(user-error "No merge-base found between %s and %s" branch1 branch2))))
"Reset to merge-base of two branches using Magit's branch selection."
(interactive)
(require 'magit)
(let* ((branch1 (magit-read-branch "Select first branch: "))
(branch2 (magit-read-branch "Select second branch: "))
(merge-base (magit-git-string "merge-base" branch1 branch2)))
(if merge-base
(progn
(magit-reset-internal "--soft" merge-base)
(message "Reset to merge-base of %s and %s" branch1 branch2))
(user-error "No merge-base found between %s and %s" branch1 branch2))))
(defun magit-reset-to-upstream ()
"Reset to upstream of the current branch using Magit."
(interactive)
(require 'magit)
(let ((current-branch (magit-get-current-branch)))
(if current-branch
(let ((upstream (magit-get-upstream-branch current-branch)))
(if upstream
(progn
(magit-reset-internal "--soft" "@{u}")
(message "Reset to upstream of %s (%s)" current-branch upstream))
(user-error "No upstream branch set for %s" current-branch)))
(user-error "Not on a branch")))))
"Reset to upstream of the current branch using Magit."
(interactive)
(require 'magit)
(let ((current-branch (magit-get-current-branch)))
(if current-branch
(let ((upstream (magit-get-upstream-branch current-branch)))
(if upstream
(progn
(magit-reset-internal "--soft" "@{u}")
(message "Reset to upstream of %s (%s)" current-branch upstream))
(user-error "No upstream branch set for %s" current-branch)))
(user-error "Not on a branch")))))
;; diagramming
;; ===
@ -699,11 +699,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))
)
)
@ -742,10 +742,10 @@
(setopt ellama-language "English")
(require 'llm-ollama)
(setopt ellama-provider
(make-llm-ollama
:chat-model "codellama:latest"
:embedding-model "nomic-embed-text"
:default-chat-non-standard-params '(("num_ctx" . 8192)))))
(make-llm-ollama
:chat-model "codellama:latest"
:embedding-model "nomic-embed-text"
:default-chat-non-standard-params '(("num_ctx" . 8192)))))
(use-package lmtf :ensure t :defer t
:straight (lmtf :type git :host github :repo "lneely/lmtf")
@ -773,7 +773,7 @@
:load-path (lambda () "~/.config/emacs/elisp/org-ai")
:commands (org-ai-mode
org-ai-global-mode
org-ai-install-yasnippets)
org-ai-install-yasnippets)
:init
(add-hook 'org-mode-hook #'org-ai-mode)
(org-ai-global-mode)
@ -823,6 +823,8 @@
(add-hook 'prog-mode-hook #'yas-minor-mode)
(add-hook 'org-mode-hook #'yas-minor-mode)
(use-package emmet-mode :ensure t :defer t)
(provide 'init)
;; Local Variables:

View File

@ -7,4 +7,4 @@
("aicld" "* ${1:What}\n\n#+begin_ai :service anthropic :model claude-3-5-sonnet-20240620\n[SYS]: ${2:You are a helpful assistant.}\n\n[ME]: ${0}\n#+end_ai\n" "aicld" nil nil nil "/home/lkn/.config/emacs/snippets/org-mode/aicld" nil nil)))
;;; Do not edit! File generated at Sun Sep 8 23:48:43 2024
;;; Do not edit! File generated at Tue Sep 10 15:15:33 2024