Skip to content

.ex files are opened as euphoria3 (again) #475

Closed
@jamesvl

Description

@jamesvl

Summary

.ex files are being set to euphoria3 file types instead of Elixir.

Source of Error

It seems this commit changed the file type settings so that .ex file types are set with setfiletype instead of set filetype=.... This causes them to no longer recognized as Elixir files (they're seen as euphoria3 files, as mentioned previously in issue #121.)

File type settings were working fine for me prior to the commit linked above.

Background

From the commit message:

Note that the Vim runtime ships with a filetype match for *.ex (for Euphoria), but our plugin-based filetype detection still gets the last say.

Maybe the above isn't working right for Neovim? But the vim help page seems to say setfiletype specifically won't work for this:

If you want to detect your file after the default file type checks:
This works like A above, but instead of setting 'filetype' unconditionally
use ":setfiletype". This will only set 'filetype' if no file type was
detected yet.

(note the last sentence; I admit I may be missing information needed to know how plugin-based filetype detection should override this)

My Setup

This is in Neovim 0.3.3 on Linux, using Pathogen to install this plugin; my init.vim has the syntax on line after pathogen#infect().

My (temporary) Workaround

Per the vim manual, put a file named ex.vim into a directory named /ftdetect in your vim config directory (which depends on vim / neovim). Place the following line in that file:

au BufRead,BufNewFile *.ex,*.exs set filetype=elixir

(This could also be place in your .vimrc / init.vim file.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions