mirror of
https://github.com/rabirabirara/obsidian-jelly-snippets.git
synced 2026-07-22 07:30:22 +00:00
Merge branch 'main' of https://github.com/rabirabirara/obsidian-jelly-snippets
This commit is contained in:
commit
6e15adc2d4
1 changed files with 26 additions and 5 deletions
27
README.md
27
README.md
|
|
@ -65,6 +65,26 @@ rhs
|
|||
superb |+| superbowls
|
||||
```
|
||||
|
||||
## Using Symbols (simple)
|
||||
|
||||
Say you want to expand `hw` into a full hello-world function. Say we're using Rust. You define the snippet:
|
||||
|
||||
```
|
||||
hw |+| fn hello() {
|
||||
%\t%\e
|
||||
}
|
||||
```
|
||||
|
||||
When you trigger the snippet, you'll end up with this:
|
||||
|
||||
```
|
||||
fn hello() {
|
||||
|
|
||||
}
|
||||
```
|
||||
|
||||
... where `|` represents your cursor. Of course, Obsidian is a markdown editor, so expect the little indent guide.
|
||||
|
||||
## Why?
|
||||
|
||||
I wanted to make a generic snippets plugin that operated on text and worked as I needed. There is an existing snippets plugin already, [Text Snippets](https://github.com/ArianaKhit/text-snippets-obsidian) by ArianaKhit, but not only is the plugin code somewhat outdated and a little complex, it seems to use an older API. (It is a very good plugin by the way.)
|
||||
|
|
@ -79,12 +99,13 @@ It's since been incorporated back into [julia.vim](https://github.com/JuliaEdito
|
|||
|
||||
## Future Improvements/TODO
|
||||
|
||||
- [ ] Control characters in snippets
|
||||
- [ ] Semantic symbols in snippets (e.g. where does cursor go afterwards? a snippet with braces might benefit from placing the cursor inside...)
|
||||
- [x] Control characters in snippets (whitespace only)
|
||||
- [x] Semantic symbols in snippets (e.g. where does cursor go afterwards? a snippet with braces might benefit from placing the cursor inside...)
|
||||
- [ ] Regex capabilities - at least on selection.
|
||||
- [ ] A backup for snippets - or a way of specifying snippets in a file, to modularize snippets. May be useful if regex snippets need to be defined separately from text snippets.
|
||||
- [ ] Bugfixes and auditing?
|
||||
- [ ] Bugfixes and auditing.
|
||||
- [ ] Do the things liamcain suggested in my plugin PR to the Obsidian plugin repo. (one half done)
|
||||
- [ ] Working with Obsidians template stuff.
|
||||
|
||||
### Other caveats
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue