diff options
author | Austin Gatlin <austin@gatlin.io> | 2021-06-26 12:02:55 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-06-26 12:02:55 +0200 |
commit | f3caeb63d62c08b579e9b5f40b35e8bf64dde87a (patch) | |
tree | 89bb7397cf7fa5eb84b9fda3f3cf66a13f5dba63 /runtime | |
parent | 6582e230a0f6592287b1123c5fc3807d6fed997e (diff) | |
download | vim-git-f3caeb63d62c08b579e9b5f40b35e8bf64dde87a.tar.gz |
patch 8.2.3050: cannot recognize elixir filesv8.2.3050
Problem: Cannot recognize elixir files.
Solution: Recognize Elixir-specific files. Check if an .ex file is Euphoria
or Elixir. (Austin Gatlin, closes #8401, closes #8446)
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/autoload/dist/ft.vim | 11 | ||||
-rw-r--r-- | runtime/filetype.vim | 11 |
2 files changed, 20 insertions, 2 deletions
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 1ac74b578..ac8065911 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -172,6 +172,17 @@ func dist#ft#FTent() setf dtd endfunc +func dist#ft#ExCheck() + let lines = getline(1, min([line("$"), 100])) + if exists('g:filetype_euphoria') + exe 'setf ' . g:filetype_euphoria + elseif match(lines, '^--\|^ifdef\>\|^include\>') > -1 + setf euphoria3 + else + setf elixir + endif +endfunc + func dist#ft#EuphoriaCheck() if exists('g:filetype_euphoria') exe 'setf ' . g:filetype_euphoria diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 496b58b31..e38bc23de 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -393,7 +393,7 @@ au BufNewFile,BufRead *.cfm,*.cfi,*.cfc setf cf " Configure scripts au BufNewFile,BufRead configure.in,configure.ac setf config -" CUDA Cumpute Unified Device Architecture +" CUDA Compute Unified Device Architecture au BufNewFile,BufRead *.cu,*.cuh setf cuda " Dockerfile; Podman uses the same syntax with name Containerfile @@ -408,8 +408,15 @@ au BufNewFile,BufRead *enlightenment/*.cfg setf c " Eterm au BufNewFile,BufRead *Eterm/*.cfg setf eterm +" Elixir or Euphoria +au BufNewFile,BufRead *.ex call dist#ft#ExCheck() + +" Elixir +au BufRead,BufNewFile mix.lock,*.exs setf elixir +au BufRead,BufNewFile *.eex,*.leex setf eelixir + " Euphoria 3 or 4 -au BufNewFile,BufRead *.eu,*.ew,*.ex,*.exu,*.exw call dist#ft#EuphoriaCheck() +au BufNewFile,BufRead *.eu,*.ew,*.exu,*.exw call dist#ft#EuphoriaCheck() if has("fname_case") au BufNewFile,BufRead *.EU,*.EW,*.EX,*.EXU,*.EXW call dist#ft#EuphoriaCheck() endif |