6 ms·
That's not minimalist, this is minimalist sn() { rg -S -C 2 $1 /some/folder/with/snippets/as/files } $ sn git #searches for snippets conta
by xaduha 6y ago
That's not minimalist, this is minimalist
sn() {
rg -S -C 2 $1 /some/folder/with/snippets/as/files
}
$ sn git #searches for snippets containing `git`
- jknz 6y agoalias rg="rg" might be more flexible as it allows you to specifify a root folder to search in as well as other options. edit: The previous sentence is a joke. This should not take away the usefulness and polish of kb.
- moonchild 6y agoTry "$@" instead of $1, for multi-word queries.
- ximm 6y agoI can do one better: Just learn to use the standard unix tools directly. If you keep stacking wrappers upon wrappers and grow to depend on them you will be totally lost once you have to work on another machine. It also makes it easier to e.g. replace grep by fzf. For reference: kb list -> find kb list foo -> find | grep foo kb edit --title "git" --category "cheatsheet" -> vim cheatsheet/git kb delete --id 1 -> rm path/to/file kb grep foo -> grep -r foo
- nebbiolo 6y agoExactly! I started from there, then these commands evolved into functions and the functions evolved into bash scripts which then evolved into a python program in order to have something more readable/structured and cross platform. But of course no software is an excuse to not learn the good old UNIX core tools. kb is not better than these tools, it just packs them up in order to have a slightly nicer output and be able to associate metadata to the notes in a clean way.
- nebbiolo 6y agoYou are right, but what about having a nicer output list? What about having metadata associated to files such as author, status and especially tags? Also, what about being cross-platform and able to run on Windows? What about instead having custom templates to apply to the files I desire?