From 992bfbcf1601f20c7eff04c1d24cffeb2a5042ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Wed, 1 Dec 2021 13:29:09 +0100 Subject: [PATCH] Add elixir filetype detect file --- symlinks/config/nvim/ftdetect/elixir.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 symlinks/config/nvim/ftdetect/elixir.vim diff --git a/symlinks/config/nvim/ftdetect/elixir.vim b/symlinks/config/nvim/ftdetect/elixir.vim new file mode 100644 index 0000000..09f9a99 --- /dev/null +++ b/symlinks/config/nvim/ftdetect/elixir.vim @@ -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) =~# '^#!.*\' + set filetype=elixir + endif +endfunction