nvim-tree / nvim-web-devicons

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

feat: add Dockerfile extension #317

Closed steschwa closed 9 months ago

steschwa commented 9 months ago

Icon for *.Dockerfile files

steschwa commented 9 months ago

What's the use case for this one? Is a Dockerfile not correctly applying somewhere?

If you want to build multiple docker images using the same context. Here's an example:

image

I am building an API that is distributed as a docker image. I therefore have a Dockerfile. To run database migrations i build another docker image. Because Dockerfile is already used i need a different filename migrations.Dockerfile. There is no official recommendation (as far as i am concerned) what naming convention to use to name multiple Dockerfiles. I found this SO https://stackoverflow.com/questions/26077543/how-to-name-dockerfiles that suggests naming them with the .Dockerfile extension.

alex-courtis commented 9 months ago

Because Dockerfile is already used i need a different filename migrations.Dockerfile.

I understand. I did not note that it's an extension rather than a name.

We could also handle the case of Dockerfile.foo which is a pattern used in the wild.

dockerfile
Dockerfile
dockerfile.bar
Dockerfile.bar
foo.dockerfile
foo.Dockerfile
foo.dockerfile.bar
foo.Dockerfile.bar

Of the additional ones, only Dockerfile.bar is recognised by nvim as ft=dockerfile

foo.dockerfile is picked up by filename.

This change is Good Enough.