Open AgatZan opened 3 weeks ago
I see the value of this filename_generator
and would love to have it inside the filetype_detail
entity.
But I think it quite a powerful user stuff, and would still remind simple config options like require_dir
, filename
, win_cwd
I consider it as a more powerful counterpart of filename
option and would like it to have higher priority to user filename_generator
over filename
if both of them are existing inside the config of a filetype_detail
entity
By the way, I guess require_dir
, filename
, and win_cwd
can all be implemented as defaults. Something like require("scratch.default.win_cmd").split_left
or require("scratch.default.file_generator").with_require_dir
Also, in this case, I don't want to sound rude, but the default way of specifying default content is not user friendly enough.
I think not that hard to make it looks something like that
filetype_details = {
lua = {
content ={
text = [[default content blah blah blah
new line ${cursor} fdsjjdf
asdfjlksdfjl]],
insert=true
}
}
}
No worry, yeah, it’s better to make it a multi line string
after creating file do
:set filetype=filetype_details[choice]
and ...Draft
Then, the function that creates a scratch buffer can appear in this way.
Benefit
Replace chore:
requireDir
,filename
andwin_cwd
, and give more power to specify what file type you need and how it should look.Examples
If you make notes, then you may want to create scratch note, you know where them live, so you can