oil.nvim icon indicating copy to clipboard operation
oil.nvim copied to clipboard

feat(icons): filetype detection via shebang

Open nobe4 opened this issue 8 months ago • 0 comments

This PR adds a step in the columns making: read the first line of the file and use that to compute a "fallback" filetype in case the filename alone cannot be used to determine the filetype.

This is then passed to the IconProvider which uses it if the icon is nil, or default.

This works well in initial tests, but vim.fn.readfile(name, '', 1) only read files in the current folder, I need to understand how I can make that work when changing folders. However, once this is done, I think this will provide some nice additional icons.

Looking forward to getting a review/suggestions :)

nobe4 avatar Apr 13 '25 19:04 nobe4