m4xshen / hardtime.nvim

Establish good command workflow and quit bad habit
MIT License
1.49k stars 25 forks source link

Possibility to run without plugins #110

Open mliszcz opened 1 month ago

mliszcz commented 1 month ago

I try to keep my setup minimal, including the numbers of plugins. Currently hardtime depends on nui and plenary. Would it be possible to remove them or make them optional?

For plenary, it is used only for ensuring that the log directory exists. https://github.com/m4xshen/hardtime.nvim/blob/main/lua/hardtime/log.lua#L172

This can be easily replaced with the builtin functions, like:

local outfile_parent_path = vim.fs.dirname(outfile)
vim.fn.mkdir(outfile_parent_path, "p")

Or maybe this is not needed at all if neovim ensures that it exists (haven't checked but e.g. shada is stored there).

For nui, I'd make it optional and fall back to a full-screen buffer if it cannot be loaded. This is not as critical as plenary, in the worst case I can roll my own command to parse the log.

mliszcz commented 1 month ago

Of course I can submit a PR if this would be accepted.

m4xshen commented 4 weeks ago

@mliszcz Thanks for the feedback. It would be great if you can submit a PR to replace plenary with builtin funciton!