Skip to content

[mini.icons] Adding icons like ansible to filetype #1017

Closed Answered by echasnovski
mstinsky asked this question in Q&A
Discussion options

You must be logged in to vote

@mstinsky, thanks to a series of refactors and optimizations (see this comment if you are curious which ones), this is now possible on latest main with a few necessary setup tweaks. Here is a setup that makes it work:

local ext_skip = { yml = true }
require('mini.icons').setup({
  use_file_extension = function(ext, _) return not ext_skip[ext:lower()] end,
})

This setup basically tells 'mini.icons' that 'yml' filetype should be ignored during "file" resolution which results in always relying on vim.filetype.match() output (which is essentially what is needed here). See help entry for more details.

Assuming the vim.filetype.add({ pattern = { ['.*/roles/.*/tasks/.*%.ya?ml'] = 'yaml.ansible' …

Replies: 4 comments 9 replies

Comment options

You must be logged in to vote
3 replies
@mstinsky
Comment options

@echasnovski
Comment options

@mstinsky
Comment options

Comment options

You must be logged in to vote
2 replies
@mstinsky
Comment options

@echasnovski
Comment options

Comment options

You must be logged in to vote
4 replies
@mstinsky
Comment options

@echasnovski
Comment options

@mstinsky
Comment options

@echasnovski
Comment options

Answer selected by echasnovski
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants