You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After the recent change that removed ftdetect, syntax highlighting is no longer working for .*eex files (.heex, .leex, etc). It appears that the default filetype detection marks these files as e.g. ft=heex instead of ft=eelixir, as the previous ftdetect plugin did.
Actual
set ft?
filetype=heex
Expected
If I run set ft=eelixir, I get this:
However, if I first run let b:eelixir_subtype = 'heex', I get this:
Not sure which of these is correct.
$ nvim --version
NVIM v0.7.0-dev+1348-g524f6294a
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by a80323765@USC02F834HMD6N
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/local/Cellar/neovim/HEAD-524f629/share/nvim"
Run :checkhealth for more info
Reacted by jchristgit, Pien van Dalen, Bernard Duggan, Jamil, Max Gorin, jonathan-duffel, Nitin Gupta and Diego Michel Rubio Ramirez
My syntax highlighting is also broken with that recent change. My computer now goes back and reads these files as euphoria3 instead of elixir.
Edit: FWIW, it is broken for .ex and .exs files as well, on my end. For now, I just added the removed lines from that latest commit into my .vimrc and it's back to perfection.
Reacted by Carter Pedersen, Michael Rode, Eric Ridgeway and Merouane Atig
I'm on latest master NeoVim and had to manually revert that commit on my local install for syntax highlighting and indentation to come back for .heex files.
as @dekkofilms mentioned, adding the following to .vimrc or init.vim fixes:
au BufRead,BufNewFile *.ex,*.exs set filetype=elixir
au BufRead,BufNewFile *.eex,*.heex,*.leex,*.sface,*.lexs set filetype=eelixir
au BufRead,BufNewFile mix.lock set filetype=elixir
Reacted by Michael Rode, Garrett Julaka, typhoontong22, Andrew Haust, jchristgit, andyl, John Curran, Bernard Duggan, Shantanu Dutta, Nicolas Savois and 12 more
Reacted by Nicolas Savois and Diego Michel Rubio Ramirez
$ nvim -v
NVIM v0.7.0-dev+1410-g2c7dc648c
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by ...
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/local/Cellar/neovim/HEAD-2c7dc64/share/nvim"
Run :checkhealth for more info
Running with nvim -u none I get the following for each extension when calling set ft?:
FWIW, it is broken for .ex and .exs files as well, on my end. For now, I just added the removed lines from that latest commit into my .vimrc and it's back to perfection.
This happened to me too with Vim 8.1. I ended up reverting this plugin to an older version for now.
HEEx and Surface are distinct tempting languages compared to LEEx and EEx (they use different compilers) and should be considered different file types so the corresponding tooling can handle their differences.
The consequence of this patch is now downstream tooling that does not use the vim-elixir plugin is breaking (for example, nvim-treesitter which uses different tree-sitter parsers for eex, heex, and surface). If vim-elixir does not make a distinction between heex, surface, and eex, resulting in issues with highlighting, then I think that is a bug in that plugin, not Vim itself.
A suggestion: consider .eex and .leex extensions as eelixir, but restore the new file types heex and surface that were recently added and fix how vim-elixir handles those file types.
Activity
dekkofilms commentedon Apr 2, 2022
My syntax highlighting is also broken with that recent change. My computer now goes back and reads these files as euphoria3 instead of elixir.
Edit: FWIW, it is broken for .ex and .exs files as well, on my end. For now, I just added the removed lines from that latest commit into my .vimrc and it's back to perfection.
superhawk610 commentedon Apr 3, 2022
@dekkofilms which version of vim/neovim are you using?
dekkofilms commentedon Apr 3, 2022
@superhawk610 my vim version is 8.2
cvincent commentedon Apr 7, 2022
I'm on latest master NeoVim and had to manually revert that commit on my local install for syntax highlighting and indentation to come back for .heex files.
RTLS commentedon Apr 8, 2022
as @dekkofilms mentioned, adding the following to
.vimrcorinit.vimfixes:jbodah commentedon Apr 8, 2022
Running with
nvim -u noneI get the following for each extension when callingset ft?:ex=>elixirheex=>heexexs=>elixireex=>eelixirleex=>eelixirsface=>surfacelexs=> (no ft)mix.lock=>elixiraptinio commentedon Apr 9, 2022
I've sent the following PRs to vim and neovim:
nickjj commentedon Apr 10, 2022
This happened to me too with Vim 8.1. I ended up reverting this plugin to an older version for now.
superhawk610 commentedon Apr 11, 2022
Copying this here since it seemed relevant:
via @connorlay, from the PR linked above to vim link
michalwski commentedon Sep 6, 2022
Hello, what's the status of the issue? Will it be fixed here in
vim-elixirlike suggested by @connorlay ?juanpabloaj commentedon Jul 14, 2023
the @RTLS recomendation worked for me. Another option is to use nvim-treesitter/nvim-treesitter
install that was not so obvious for me, so here my steps
add the plugin to your
~/.config/nvim/init.vimand install it
enable the highlight in your
~/.config/nvim/lua/init.luaand finally install elixir
nvim, replaced vim-exilir with nvim-treesitter
matt-savvy commentedon Oct 4, 2024
For neovim users with lua configs, adding this to my init.lua resolved it for me.