You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
after creating file do :set filetype=filetype_details[choice] and ...
Draft
-- config
{
-- ...manual_selector_text="MANUAL_INPUT",
-- If it really matter to make default choice, not that hard to generate some defaults for win_conf--[[ window-relative float {relative='win', row=3, col=3, width=12, height=3} vertical split left of the current window {split = 'left', win = 0}]]win_conf= {} ---@see: `nvim_open_win`,select_options= {"lua", "lua-prof", "foo-bar"},
filetype_details= {
["lua-prof"] = {
filetype="lua",
content= {"strings..."},
cursor= { location= {0, 5}, insert=true },
---@typefun(string):stringfilename_generator=function(scratch_path) end, --gen new name with folders if neededwin_conf= {} ---@see: `nvim_open_win`
}
}
}
Then, the function that creates a scratch buffer can appear in this way.
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
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
The text was updated successfully, but these errors were encountered: