From 9718c0bfff81985c4f248a87b71e35987ff43d86 Mon Sep 17 00:00:00 2001 From: John Doty Date: Wed, 27 Apr 2022 16:51:08 -0700 Subject: [PATCH] howm mode for notes --- .emacs.d/custom.el | 2 +- .emacs.d/init.el | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/.emacs.d/custom.el b/.emacs.d/custom.el index cc12d54..7e0ab1b 100644 --- a/.emacs.d/custom.el +++ b/.emacs.d/custom.el @@ -58,7 +58,7 @@ '(org-odd-levels-only t) '(org-todo-keywords '((sequence "TODO" "|" "DONE" "ABANDONED" "DEFERRED"))) '(package-selected-packages - '(python-mode color-theme-sanityinc-solarized monokai-theme rust-mode tide typescript-mode modus-themes tree-sitter flycheck-rust eglot ink-mode prettier-js zig-mode esup gnu-elpa-keyring-update lsp-hack hack-mode filladapt lsp-ui yaml-mode wgrep fsharp-mode company-lsp cquery mustache-mode clang-format projectile dash-functional mocha add-node-modules-path rjsx-mode xref-js2 js2-refactor company omnisharp geiser cider clojure-mode graphviz-dot-mode multi-term xterm-color thrift markdown-mode tuareg merlin ag use-package flycheck dockerfile-mode js2-mode web-mode tss switch-window paredit magit lua-mode go-mode go-autocomplete exec-path-from-shell csharp-mode color-theme-monokai auto-complete auto-complete-nxml flymake flyspell json-mode popup ruby-mode company-jedi elm-mode monky color-theme-sanityinc-tomorrow)) + '(howm python-mode color-theme-sanityinc-solarized monokai-theme rust-mode tide typescript-mode modus-themes tree-sitter flycheck-rust eglot ink-mode prettier-js zig-mode esup gnu-elpa-keyring-update lsp-hack hack-mode filladapt lsp-ui yaml-mode wgrep fsharp-mode company-lsp cquery mustache-mode clang-format projectile dash-functional mocha add-node-modules-path rjsx-mode xref-js2 js2-refactor company omnisharp geiser cider clojure-mode graphviz-dot-mode multi-term xterm-color thrift markdown-mode tuareg merlin ag use-package flycheck dockerfile-mode js2-mode web-mode tss switch-window paredit magit lua-mode go-mode go-autocomplete exec-path-from-shell csharp-mode color-theme-monokai auto-complete auto-complete-nxml flymake flyspell json-mode popup ruby-mode company-jedi elm-mode monky color-theme-sanityinc-tomorrow)) '(reb-re-syntax 'string) '(rmail-mail-new-frame t) '(safe-local-variable-values diff --git a/.emacs.d/init.el b/.emacs.d/init.el index e070f87..37bdab5 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1068,5 +1068,51 @@ Or, uh, Objective C, I guess." :config (add-hook 'ink-mode-hook 'my-ink-mode-hook)) +;; ================================================================= +;; Note taking +;; ================================================================= +;; howm http://howm.osdn.jp/ +;; Based on http://dotyl.ink/l/kc56hcn64e + +(defvar my-dropbox-dir + (expand-file-name + (cond + ((file-directory-p "~/Dropbox (Personal)") "~/Dropbox (Personal)") + ((file-directory-p "~/Dropbox") "~/Dropbox"))) + "Where is my dropbox?") + +(use-package howm :ensure + :init + ;; Directory configuration + ;; + ;; (This is in :init because apparently you need to set this stuff before + ;; you load howm?) + (setq howm-home-directory (expand-file-name "notes/howm" my-dropbox-dir)) + (setq howm-directory howm-home-directory) + (make-directory howm-directory t) + (setq howm-keyword-file (expand-file-name ".howm-keys" howm-home-directory)) + (setq howm-history-file (expand-file-name ".howm-history" howm-home-directory)) + (setq howm-file-name-format "%Y/%m/%Y-%m-%d-%H%M%S.md") + + ;; Use ripgrep as grep + (setq howm-view-use-grep t) + (setq howm-view-grep-command "rg") + (setq howm-view-grep-option "-nH --no-heading --color never") + (setq howm-view-grep-extended-option nil) + (setq howm-view-grep-fixed-option "-F") + (setq howm-view-grep-expr-option nil) + (setq howm-view-grep-file-stdin-option nil) + + :config + ;; un-bind control-h from the howm thing + (define-key howm-menu-mode-map "\C-h" nil) + (define-key riffle-summary-mode-map "\C-h" nil) + (define-key howm-view-contents-mode-map "\C-h" nil) + + ;; Rename buffers to their title + (add-hook 'howm-mode-hook 'howm-mode-set-buffer-name) + (add-hook 'after-save-hook 'howm-mode-set-buffer-name) + ) + ;;; init.el ends here