4 ms·
In case this is useful to others, this is the config I myself use to couple Howm to Org-mode: (use-package howm :after org :init ;; Org-c
by setopt 2y ago
In case this is useful to others, this is the config I myself use to couple Howm to Org-mode:
(use-package howm
:after org
:init
;; Org-compatible filenames and syntax.
(setq howm-file-name-format "%Y-%m-%d-%H%M%S.org")
(setq howm-view-title-header "*")
(setq howm-dtime-format (format "<%s>" (cdr org-timestamp-formats)))
;; Use ripgrep for fast searching.
(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)
;; Make the "comefrom links" case-insensitive.
(setq howm-keyword-case-fold-search t)
;; Get rid of the old-fashioned separators.
(setq howm-view-summary-sep "\t")
:bind
;; Keybindings to list or create notes.
("<f12>" . howm-list-all)
("<C-f12>" . howm-create)
:config
;; Where to store data.
(setq howm-directory "~/Documents/wiki")
(setq howm-home-directory howm-directory)))
The way I use it is that Ctrl+F12 captures a new note. Once you have a few notes, press F12 to browse them – in that mode, you can press n/p/RET to preview and open notes, s to search through headings, g to (rip)grep through the full text of notes, S to sort the hits, or c to create another new note from that mode. (I largely ignore Howm's default "menu buffer" in favor of the "list all" buffer.)
Note that you can make the titles and dates even more Org-compatible:
(setq howm-view-title-header "#+title: ")
(setq howm-dtime-format (format "#+date: <%s>" (cdr org-timestamp-formats)))
After trying both, I prefer the system above, since Howm supports multiple titles in a single file which maps better to Org headings. Plus, this makes the F12 menu quite a bit cleaner... (You can still manually add titles and dates in the Org format before exporting the note, Howm doesn't mind that.)
- artsi0m 2y agoMine is much simpler (use-package howm) Although I am the one who use it with org-mode too. I've done it using prop-line feature of emacs and my own interactive, for today it is only interactive, function howm-insert-prop-line: (defun howm-insert-prop-line () "Activate major mode and modify the file so that this mode is activated automatically the next time it is opened" (interactive) (howm-mode) (let* ((modes (mapcar #'cdr auto-mode-alist)) (mode-name (completing-read "Choose major mode: " modes)) (mode (intern-soft mode-name))) (unless (or (null mode) (eq mode major-mode)) (funcall mode) (howm-mode) (add-file-local-variable-prop-line 'mode (intern (string-trim-right mode-name "-mode\\'")))))) It is in github repo, too although it is not yet finished: https://github.com/artsi0m/howm-use-any-markup https://github.com/artsi0m/howm-use-any-markup My problem is that I can't combine well nested interactive+let or let+interactive, so it is only as interactive function for now.
- setopt 2y agoInteresting idea. I guess one alternative approach would be to defadvice “howm-create” to prompt for a major mode, e.g. by let-binding the “howm-template” variable to contain “-- mode: … --“ on top and prompt the user for a mode?
- artsi0m 2y agoThanks, this sound reasonable actually. Maybe, I would think about implementing it in this way. Actually I don't really want to create a separate emacs package, but rather merge my code with main howm repo at some point, when it would be good enough. Creating your own package would be acceptable alternative to this, though. I also should add, that I can add enabling external grep part to my short howm config, but it seems to slow down howm, rather speed it up, when using it on windows.