In cases like these, it would be nice to be able to define some custom highlight groups, perhaps something like this:
function has_ts_source(bufnr, name)
--impl left to the imagination
end
require'oil'.setup {
-- ...
view_options = {
get_custom_highlight = function(name, bufnr)
if name:gmatch'(.js|.map|.d.ts)$' and has_ts_source(name, bufnr) then
return { 'OilArtifact' }
end
end,
},
}
vim.cmd.highlight('link OilArtifact Comment')
Provide background
When working in a TypeScript project, it is common to have some build artifacts generated for each source file:
In this case, the user wants the .d.ts, .js and .map artifacts to appear in the buffer, but to receive subdued highlighting.
This is not the same as hiding gitignored files, because oftentimes the user still wants to be able to inspect build artifacts (for example, to verify that they were compiled as expected, or to insert debugging code in the runtime files).
Did you check existing requests?
Describe the feature
In cases like these, it would be nice to be able to define some custom highlight groups, perhaps something like this:
Provide background
When working in a TypeScript project, it is common to have some build artifacts generated for each source file:
In this case, the user wants the
.d.ts
,.js
and.map
artifacts to appear in the buffer, but to receive subdued highlighting.This is not the same as hiding gitignored files, because oftentimes the user still wants to be able to inspect build artifacts (for example, to verify that they were compiled as expected, or to insert debugging code in the runtime files).
What is the significance of this feature?
nice to have
Additional details
Similar to #375 Similar to https://github.com/nvim-neo-tree/neo-tree.nvim/issues/118