cvigilv / esqueleto.nvim

Reduce your boilerplate code the lazy-bones way
MIT License
98 stars 7 forks source link

Integration with Dressing.nvim #8

Closed DrKGD closed 1 year ago

DrKGD commented 1 year ago

Hello there, first of all I do appriciate your work and thanks for the plugin!

Just found out about the plugin, so added the following lines in my configuration (./lua/paks/esqueleto/init.lua) image

├── lua
│   ├── paks
│   │   ├── esqueleto
│   │   │   ├── init.lua
│   │   │   └── templates
│   │   │       └── LICENSE
│   │   │           └── MIT

Thus I shamelessly stolen the template for the MIT License just to test it out.

It doesn't always work (does not detect the file as an empty file?), probably something wrong on my side, but when it does, with Dressing.nvim I'd get a prompt like the following image

Thus confirming that at least the configuration is not completly bogus: once selected the file LICENSE is empty.

EDIT 1: Not sure why but filename doesn't always return the filename but, instead, the full path to the file, thus that's the reason it doesn't always work (it does not match the file).

Using %:t instead seems to be working as expected

M.Esqueleto = function()
  -- only prompt if template hasn't been inserted
  local filepath = vim.fn.expand("%:p")
  local filename = vim.fn.expand("%:t") -- <
  local filetype = vim.bo.filetype

EDIT 2: Dressing vim.ui.select is async, thus selection is never set and select returns nil instead.

cvigilv commented 1 year ago

Let me adress step by step:

  1. There is a bug with the variable filename, I'm going to fix it ASAP.
  2. I'm currently developing the UI for esqueleto, in a couple of week I should have a working prototype
  3. Maybe I could add support for dressing.nvim, but it will be low in my priorities for the time being

P.D. Whats your colorscheme and font? looks nice for creating example gifs and images.

Thanks for the issue!

DrKGD commented 1 year ago

Glad you like my setup! The first isn't really a screenshot, more like a snippet of code taken with 0oAstro/silicon.lua, which does in fact use some of the highlight groups defined by the colorscheme.

As for the colorscheme I am using a slighty modified version of the carbonfox variant of EdenEast/nightfox.nvim, while the font is M PLUS Code Latin 60

This is what a real screenshot looks like (Stock awesome wm, just killed the picom compositor to disallow the transparency, with wezterm as terminal emulator) image

As for the issues, no problem at all! I will be patiently wait for an update :yum:

cvigilv commented 1 year ago

I'm currently working in the insertion prompt UI, once that's out of the way I may add support for Dressing.nvim