Vim has a nice way of dictating what syntax highlighter shall be used with a specific file (disregarding the file extension by specifying the keyword vim:filetype in the beginning or at the end of the file.)
Is there an equivalent way of suggesting vscode to use a syntax highlighter with a file without paying attention to its file extension?
Example: in vim
# vim:filetype=i3
set $mod Mod4
set $alt Mod1
...
I am not looking for
files.associationsor theChange Language Modesettings. I want to state the language mapping within the file itself and I understand that probably this is not a builtin feature just hoping an extension can do thisWhy I am interested in this? because many of the so-called dotfiles in Linux don't have any special extension and when you open the file in another vscode instance (in another machine) you want the IDE to be intelligent enough to deduce the correct syntax highlighter.

I know this question has been around for quite some time now but I thought I should share that this is now possible through a third party extension: https://marketplace.visualstudio.com/items?itemName=chrislajoie.vscode-modelines
I have not tested this myself but it has a lot of installs with absolutely no bad press so it should work properly.
Repo: https://github.com/ctlajoie/vscode-modelines