Replies: 1 comment 4 replies
-
I am afraid 'mini.icons' was (deliberately) not really designed to make this kind of adjustment straightforward. The only way to have icon be decided based on pattern matching is indeed by using One way to make it less painful for overall setup is to use custom filetype which starts with Here is the setup for you to try: vim.filetype.add({
pattern = {
['.*/spec/.*%.rb'] = 'ruby.spec',
['.*_spec%.rb'] = 'ruby.spec',
},
})
require('mini.icons').setup({
filetype = {
['ruby.spec'] = { glyph = '', hl = 'MiniIconsAzure' },
},
-- Make sure that .rb extension is not used during resolution and
-- filetype matching is used instead
use_file_extension = function(ext, _) return ext:sub(-2) ~= 'rb' end,
}) So what is left is to adjust LSP (is there anything else?) to be autostarted in 'ruby.spec' filetype also. But if you use |
Beta Was this translation helpful? Give feedback.
-
I'm trying to set a distinct icon for Ruby spec files to visually differentiate them from other ruby files. These files can be identified by:
_spec.rb
(eg:user_controller_spec.rb
)./spec/**/*
directoryI've explored the following config options:
extension
: Not applicable since_spec.rb
isn't a true extension, and I don't want to affect all*.rb
files.file
: Works for specific files but doesn't support patterns.filetype
: I could add a custom vim filetype. It seems very far-reaching, as it would require handling implications with treesitter, lsp, etc.I'm curious if anyone has any other "outside the box" thoughts for this problem.
Beta Was this translation helpful? Give feedback.
All reactions