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

Can default_text have option to be a function? And then pass the filename as a parameter we can use? #9

Open
GitMurf opened this issue May 25, 2024 · 1 comment

Comments

@GitMurf
Copy link
Contributor

GitMurf commented May 25, 2024

This plugin is amazing... just what I needed!

One thing I find myself wanting is to create default_text dynamically via a function. Is this something you would consider? allowing to define as a function and then providing function parameters of the filename and also would be nice if could provide the type of gitpad (project, branch, daily note, or current file) so that we can do some conditional logic based on the type of gitpad. Thoughts?

@yujinyuz
Copy link
Owner

@GitMurf Thanks! Glad you liked this plugin

That sounds like a nice idea. Maybe we could just use the opts for similar to what we did for the title where you can just pass the title parameter when toggling notes

Maybe something like:

local date_filename = 'daily-' .. os.date('%Y-%m-%d.md')
require('gitpad').toggle_gitpad { filename = date_filename, on_attach = function() end, default_text = function() end, title = 'Daily Notes }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants