Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Vscode Snippets instead of own templates #90

Open
pajoma opened this issue Jul 8, 2021 · 3 comments
Open

Use Vscode Snippets instead of own templates #90

pajoma opened this issue Jul 8, 2021 · 3 comments

Comments

@pajoma
Copy link
Owner

pajoma commented Jul 8, 2021

The extension already defines snippets, which are added the global user snippets. The snippets have names, which we could also reference in the settings.

So instead of

 "journal.templates": [
    {
      "name": "memo", 
      "template": "- ${d:HHmm}: ${input}", 
      "after": "## Notes"
    }
  ]

we would write

 "journal.templates": [
    {
      "name": "memo", 
      "snippet": "Add memo"
      "after": "## Notes"
    }
  ]

with the snippet

{
    "Add memo": {
        "prefix": "memo",
        "body": [
            "- Memo: $CURRENT_HOUR:$CURRENT_MINUTE ${1:description}"
        ],
        "description": "Snippet for adding a new memo"
    }
}

We still need the template definition to configure where the generate snippet has to be inserted, but we could get rid of the formatting instructions.

@pajoma pajoma added this to the 0.13 milestone Jul 8, 2021
@pajoma
Copy link
Owner Author

pajoma commented Jul 8, 2021

@mameen is this approach a solution for your idea in #19 (comment)?

@mameen
Copy link

mameen commented Jul 9, 2021

regarding where to insert the snippet I just use Ctrl+SPACE in the place I want to add it.. and all snippets that apply show up! sorry if this is already a known fact! just my 2 cents!

@pajoma
Copy link
Owner Author

pajoma commented Apr 28, 2022

I can't find any api to access the available snippets (which I would need to access to inject the tasks, memos, etc.).

@pajoma pajoma added the wontfix label Apr 28, 2022
@pajoma pajoma modified the milestones: 2.0, On Hold Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants