summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--init.el91
-rw-r--r--lisp/km-god.el36
-rw-r--r--lisp/km-magit.el16
-rw-r--r--lisp/km-org-agenda.el2
5 files changed, 51 insertions, 96 deletions
diff --git a/.gitignore b/.gitignore
index 9e551ec..5b4fe7a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
/auto-save-list
cache
/bookmarks
+/eln-cache/
/history
/lisp/km-untracked.el
/.mc-lists.el
@@ -24,3 +25,4 @@ cache
/lisp/km-emacs-autoloads.el
/lisp/mail-config.el
/transient
+/debbugs
diff --git a/init.el b/init.el
index 198b95b..1c9ee1a 100644
--- a/init.el
+++ b/init.el
@@ -91,6 +91,7 @@
(define-prefix-command 'km/dired-prefix-map)
(define-prefix-command 'km/dired-subtree-prefix-map)
(define-prefix-command 'km/gnus-summary-prefix-map)
+(define-prefix-command 'km/ledger-prefix-map)
(define-prefix-command 'km/magit-map)
(define-prefix-command 'km/magit-wip-map)
(define-prefix-command 'km/org-prefix-map)
@@ -153,9 +154,9 @@
org-goto-max-level 3)
(setq org-startup-folded t)
- (setq org-default-notes-file "~/notes/tasks.org")
- (setq org-agenda-text-search-extra-files
- (file-expand-wildcards "~/notes/extra/*.org"))
+ (setq org-directory (expand-file-name "~/tasks/"))
+ (setq org-default-notes-file (concat (file-name-as-directory org-directory)
+ "tasks.org"))
(setq org-reverse-note-order t)
(setq org-refile-targets '((nil :maxlevel . 2))
@@ -381,8 +382,8 @@
#'km/org-agenda-set-restriction-lock))
:config
- (setq org-directory "~/notes/")
- (setq org-agenda-files "~/notes/agenda-files")
+ (setq org-agenda-files (concat (file-name-as-directory org-directory)
+ "agenda-files"))
(add-hook 'org-agenda-finalize-hook #'km/org-agenda-cd-and-read-dir-locals)
(add-hook 'org-agenda-finalize-hook #'km/org-agenda-store-current-span)
@@ -892,7 +893,7 @@
:load-path "~/src/emacs/compat/")
(use-package with-editor
- :load-path "~/src/emacs/with-editor/")
+ :load-path "~/src/emacs/with-editor/lisp/")
(use-package transient
:load-path "~/src/emacs/transient/lisp"
@@ -980,9 +981,9 @@
(transient-append-suffix 'magit-diff "t"
'("e" "Edit options" magit-diff-refresh))
(transient-append-suffix 'magit-diff "-w"
- '("-d" "Diff filter" "--diff-filter=" read-from-minibuffer))
+ '("-d" "Diff filter" "--diff-filter="))
(transient-append-suffix 'magit-diff-refresh "-w"
- '("-d" "Diff filter" "--diff-filter=" read-from-minibuffer))
+ '("-d" "Diff filter" "--diff-filter="))
(transient-suffix-put 'magit-stash "Z" :key "s")
@@ -1158,7 +1159,7 @@
(transient-append-suffix 'magit-log "l"
'("d" "Log dwim" km/magit-log-dwim))
- (transient-append-suffix 'magit-log "d"
+ (transient-append-suffix 'magit-log "s"
'("y" "Cherry dwim" km/magit-cherry-dwim))
(transient-append-suffix 'magit-merge "m"
@@ -1232,40 +1233,6 @@
(use-package setkey
:bind ("C-c v" . setkey-call))
-(use-package god-mode
- :bind (("C-c d" . god-local-mode)
- ("C-x C-1" . delete-other-windows)
- ("C-x C-2" . split-window-below)
- ("C-x C-3" . split-window-right))
- :config
- (add-hook 'view-mode-hook
- (lambda ()
- (if view-mode (god-local-mode-pause) (god-local-mode-resume))))
- (add-hook 'org-capture-mode-hook
- (lambda () (god-local-mode -1)))
-
- (add-hook 'god-mode-enabled-hook
- (lambda ()
- (when view-mode
- (view-mode -1))
- (when (derived-mode-p 'emacs-lisp-mode)
- (lispy-mode -1))))
- (add-hook 'god-mode-disabled-hook
- (lambda ()
- (when (derived-mode-p 'emacs-lisp-mode)
- (lispy-mode 1))))
- (bind-keys :map god-local-mode-map
- ("." . repeat)
- ("i" . god-local-mode))
-
- (require 'km-god))
-
-(use-package km-god
- :config
- (add-to-list 'god-exempt-predicates #'km/god-gnus-p)
- (add-hook 'god-mode-enabled-hook #'km/god-update-cursor)
- (add-hook 'god-mode-disabled-hook #'km/god-update-cursor))
-
(use-package km-hydra
:bind (("C-c n" . km/hydra-outline-mode)
("C-c w" . hydra-window-map/body))
@@ -1509,6 +1476,10 @@
("a" . km/zsh-ansi-term)
("t" . km/open-external-terminal)))
+(use-package vterm
+ :init
+ (bind-keys :map km/external-map ("v" . vterm)))
+
;;; Other external programs
@@ -1762,21 +1733,35 @@
(use-package ledger-mode
:init
- (and (boundp 'font-lock-global-modes)
- (pcase font-lock-global-modes
- ('t
- (setq font-lock-global-modes '(not ledger-mode)))
- (`(not . ,_)
- (add-to-list 'font-lock-global-modes 'ledger-mode t))
- (`(,_ . ,_)
- (setq font-lock-global-modes
- (delq 'ledger-mode font-lock-global-modes))))))
+ (bind-keys :map km/ledger-prefix-map
+ ("a" . km/ledger-insert-account)
+ ("p" . km/ledger-insert-payee))
+ :config
+ (defun km/ledger-insert-account ()
+ (interactive)
+ (insert (completing-read "Account: " (ledger-accounts-list))))
+
+ (defun km/ledger-insert-payee ()
+ (interactive)
+ (insert (completing-read "Payee: " (ledger-payees-in-buffer))))
+
+ (bind-keys :map ledger-mode-map
+ ("C-c m" . km/ledger-prefix-map)))
(use-package rst
:defer t
:config
(add-hook 'rst-mode-hook #'flyspell-mode))
+(use-package denote
+ :bind (("C-c d d" . denote)
+ ("C-c d t" . denote-type))
+ :config
+ (setq denote-directory
+ (expand-file-name (file-name-as-directory
+ (format-time-string "~/notes/%Y"))))
+ (setq denote-file-type 'text))
+
;;; Language modes
@@ -2048,6 +2033,8 @@
(add-to-list 'notmuch-show-stash-mlarchive-link-alist
'("yhetil-orgmode" . "https://yhetil.org/orgmode/"))
+ (add-to-list 'notmuch-show-stash-mlarchive-link-alist
+ '("orgmode-list" . "https://list.orgmode.org/"))
(advice-add
'notmuch-show-forward-message :around
diff --git a/lisp/km-god.el b/lisp/km-god.el
deleted file mode 100644
index 4d741b4..0000000
--- a/lisp/km-god.el
+++ /dev/null
@@ -1,36 +0,0 @@
-;;; km-god.el --- God mode extensions
-
-;; Copyright Kyle Meyer <kyle@kyleam.com>
-
-;; Author: Kyle Meyer <kyle@kyleam.com>
-;; URL: https://git.kyleam.com/emacs.d
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Code:
-
-(require 'god-mode)
-
-(defun km/god-update-cursor ()
- (setq cursor-type (if god-local-mode 'bar 'box)))
-
-(defun km/god-gnus-p ()
- "Return non-nil if a Gnus-related mode is enabled."
- (derived-mode-p 'gnus-group-mode
- 'gnus-summary-mode
- 'gnus-article-mode
- 'message-mode))
-
-(provide 'km-god)
-;;; km-god.el ends here
diff --git a/lisp/km-magit.el b/lisp/km-magit.el
index 3dd433c..1f9caa9 100644
--- a/lisp/km-magit.el
+++ b/lisp/km-magit.el
@@ -57,12 +57,14 @@ a proper commit."
(cl-case (length files)
(0 (user-error "No tracked files with changes"))
(1
- (magit-run-git "commit" "--all" "--message"
- (concat (funcall (if no-directory
- #'file-name-nondirectory
- #'identity)
- (car files))
- ": Update")))
+ (let ((file (car files)))
+ (magit-run-git "commit" "--all" "--message"
+ (concat (funcall (if no-directory
+ #'file-name-nondirectory
+ #'identity)
+ file)
+ (and (magit-rev-verify (concat "HEAD:" file))
+ ": Update")))))
(t
(km/magit-auto-commit)))))
@@ -546,7 +548,7 @@ argument."
(defun km/magit-rev-ancestor-p (rev-a rev-b)
"Report whether REV-A is an ancestor of REV-B."
(interactive
- (let* ((rev-a (magit-read-branch-or-commit "Ancestor candidate")))
+ (let ((rev-a (magit-read-branch-or-commit "Ancestor candidate")))
(list rev-a (magit-read-other-branch-or-commit
(format "Is %s an ancestor of" rev-a)
rev-a))))
diff --git a/lisp/km-org-agenda.el b/lisp/km-org-agenda.el
index c0f9539..ded7afc 100644
--- a/lisp/km-org-agenda.el
+++ b/lisp/km-org-agenda.el
@@ -33,7 +33,7 @@
(defun km/org-agenda-cd-and-read-dir-locals ()
(unless (get 'org-agenda-files 'org-restrict)
- (setq default-directory (expand-file-name "~/notes/"))
+ (setq default-directory org-directory)
(hack-local-variables)))
(defun km/org-agenda-store-current-span ()