nvim-tree / nvim-web-devicons

lua `fork` of vim-web-devicons for neovim
MIT License
1.93k stars 183 forks source link

compose.yml , should have the same icon as docker-compose.yml and Dockerfile #329

Closed Nikola-Milovic closed 3 weeks ago

Nikola-Milovic commented 8 months ago

It seems that docker-compose.yaml is now compose.yaml as preferred by docker compose, source, would be nice to have the blue whale icon instead of the cog that is currently there

Akmadan23 commented 8 months ago

You're right, thanks for reporting it.

mrlectus commented 3 weeks ago

You're right, thanks for reporting it.

What of compose-*.yml?

alex-courtis commented 3 weeks ago

You're right, thanks for reporting it.

What of compose-*.yml?

It doesn't look like they are part of the spec: https://docs.docker.com/compose/compose-application-model/

What's your use case?

mrlectus commented 3 weeks ago

You're right, thanks for reporting it.

What of compose-*.yml?

It doesn't look like they are part of the spec: https://docs.docker.com/compose/compose-application-model/

What's your use case?

Different compose file for test, development and production. e.g. compose-dev.yaml

gegoune commented 3 weeks ago

This is common practice but we can't anticipate and add all possible filenames and since we are not pattern match at all I am afraid it is down to users to set additional configuration.

mrlectus commented 3 weeks ago

This is common practice but we can't anticipate and add all possible filenames and since we are not pattern match at all I am afraid it is down to users to set additional configuration.

How do i set it?

alex-courtis commented 3 weeks ago

You could:

  1. add a filetype mapping for dockerfile e.g. require("nvim-web-devicons").set_icon_by_filetype { dockerfile = "Dockerfile", }
  2. add individual mappings like compose-dev.yaml in your setup

1 will not work for plugins that don't see filetype like nvim-tree but should work for dynamic plugins like lualine.

mrlectus commented 2 weeks ago

You could:

1. add a [filetype mapping](https://github.com/nvim-tree/nvim-web-devicons?tab=readme-ov-file#getting-and-setting-icons-by-filetype) for `dockerfile` e.g. `require("nvim-web-devicons").set_icon_by_filetype { dockerfile = "Dockerfile", }`

2. add individual mappings like `compose-dev.yaml` in your [setup](https://github.com/nvim-tree/nvim-web-devicons?tab=readme-ov-file#setup)

1 will not work for plugins that don't see filetype like nvim-tree but should work for dynamic plugins like lualine.

i did this and it worked

require("nvim-web-devicons").set_icon {
  ["compose-prod.yaml"] = {
    icon = "󰡨",
    color = "#458ee6",
    cterm_color = "68",
    name = "Dockerfile"
  },
}
alex-courtis commented 7 hours ago

i did this and it worked

Fantastic, glad to hear it's working for you.