Add elixir filetype detect file

pull/2/head
Ensar Sarajčić 2021-12-01 13:29:09 +01:00
parent c4bfaacbe5
commit 992bfbcf16
1 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,12 @@
" Taken from https://github.com/elixir-editors/vim-elixir - full plugin not
" needed due to treesitter support
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
au BufRead,BufNewFile * call s:DetectElixir()
function! s:DetectElixir()
if (!did_filetype() || &filetype !=# 'elixir') && getline(1) =~# '^#!.*\<elixir\>'
set filetype=elixir
endif
endfunction