Hi All!
I developed my first obsidian plugin for organizing, searching, and copying out code snippets.
The plugin builds an index of all fenced code snippets and lets you:
- filter by folder and language
- search with free text
- mark favorites
I have templating on the roadmap so that you can denote parts of the snippet to be replaced on copy:
- {{a|b|c}} for selecting from a list
- {{today}} for inserting todays date, with math i.e. {{today-1w}}
- {{my_secret:defualt_value}} for defaults
It has been submitted for review and is available via brat
5 Likes
available here on github @ brielms/SnippetBase
All feedback is welcome!
I have a lot of code files in folders with no fences as they are executable files. Would it be within the scope of the plugin to keep track of these as well? (I didn’t try, hence the question.)
2 Likes
I had not considered that use case!
You have for example *.py files in your vault?
Yeah, .py, .js, .ts standalones and jsx, mainly. And as one is more and more inclined to use AI IDE’s alongside Obsidian and allow .py scripts to be created and run, those .py scripts would surely accumulate.
But as I said, I don’t see how an organizer plugin would make sense to keep track of them. Until I saw this post, I didn’t really think about it. All my code files are in some rather deeply nested folder structure with the folders favourited in my operating systems’ file managers, currently.