diff --git a/404.html b/404.html index 354044c..c392eee 100644 --- a/404.html +++ b/404.html @@ -148,12 +148,66 @@
Note
+Start this with cadmus find
This starts a find dialog with a preview of the note on the side.
+After running the command type in the name or directory of a note and the fuzzy matches will be presented with an instant preview to the side.
+Press Ctrl+Q to toggle searching inside the note for a string, any matches will be highlighted.
+Pressing Enter on a note will open it in the default app, 1 if you want to do something else with it copy the path to the clipboard with Alt+w as described below in Keyboard Shortcuts.
+Keys | +Description | +
---|---|
PgUp / PgDn | +Scroll Preview | +
Ctrl-w | +Copy Absolute path to note 2 | +
Alt-w | +Copy Relative path to note | +
Ctrl-o | +Open the note in the default app without exiting | +
Alt-y | +Copy File Contents to Clipboard 3 | +
So essentially this just uses skim and bat to filter/preview the notes, the interactive command is used with ripgrep and piping (that took me forever to figure out!!) to highlight the match in the preview.4 This is the code that achieves it:
+sk --ansi -m -c 'rg -l -t markdown --ignore-case "{}"' \
+ --preview "bat {} 2> /dev/null \
+ --color=always --line-range :500 \
+ --terminal-width 80 \
+ --theme=TwoDark |\
+ rg --pretty --colors --context 20 {cq} \
+ --no-line-number --ignore-case \
+ --colors 'match:fg:21,39,200' \
+ --colors 'line:style:nobold' \
+ --colors 'match:style:bold' \
+ --colors 'match:bg:30,200,30'" \
+ --bind 'ctrl-f:interactive,pgup:preview-page-up,pgdn:preview-page-down' \
+ --bind 'ctrl-w:execute-silent(echo {} |\
+ xargs realpath |\
+ xclip -selection clipboard)' \
+ --bind 'alt-w:execute-silent(echo {} | xclip -selection clipboard)' \
+ --bind 'alt-v:execute-silent(code -a {}),alt-e:execute-silent(emacs {})' \
+ --bind 'ctrl-o:execute-silent(xdg-open {})' \
+ --bind 'alt-y:execute-silent(cat {} | xclip -selection clipboard)' \
+ --bind 'alt-o:execute-silent(cat {} |\
+ pandoc -f markdown -t html --mathml |\
+ xclip -selection clipboard)' \
+ --bind 'alt-f:execute-silent(echo {} |\
+ xargs dirname |\
+ xargs cd; cat {} |\
+ pandoc -f markdown -t dokuwiki --mathml |\
+ xclip -selection clipboard)' \
+ --color=fg:#f8f8f2,bg:-1,matched:#6272a4,current_fg:#50fa7b,current_bg:#381070,border:#ff79c6,prompt:#bd93f9,query:#bd93f9,marker:#f1fa8c,header:#f1fa8c
+
Imagine you're sitting at your desk and all of a sudden you're required to, I don't know, solve a linear recurrence relation, you're solution is cadmus find
and then type something like math mod
then Ctrl-Q linear.
xdg-open
/ open
on Linux/Mac respectively ↩
TODO: this only works on Xorg at the moment ↩
+This is really good for Zulip / Discord ↩
+This highlighting works with both bat and MDCat, I prefer MDCat but there is a bug with footnotes preventing me from being able to use it right at the moment. ↩
+Cadmus is a knowledge management tool in your terminal.
+Cadmus provides command driven interface to find and edit Markdown files, such as finding by name, searching for terms, filtering by tags, generating backlinks and generating relative links to other notes.