aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/filetype.vim15
-rw-r--r--src/nvim/testdir/test_filetype.vim2
2 files changed, 15 insertions, 2 deletions
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 4e617052a9..4e54bcaefd 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -692,12 +692,21 @@ au BufNewFile,BufRead .gtkrc,gtkrc setf gtkrc
au BufNewFile,BufRead *.haml setf haml
" Hamster Classic | Playground files
-au BufNewFile,BufRead *.hsc,*.hsm setf hamster
+au BufNewFile,BufRead *.hsm setf hamster
+au BufNewFile,BufRead *.hsc
+ \ if match(join(getline(1,10), "\n"), '\%(^\|\n\)\s*\%({-#\_s*LANGUAGE\>\|\<module\>\)') != -1 |
+ \ setf haskell |
+ \ else |
+ \ setf hamster |
+ \ endif
" Haskell
au BufNewFile,BufRead *.hs,*.hs-boot setf haskell
au BufNewFile,BufRead *.lhs setf lhaskell
au BufNewFile,BufRead *.chs setf chaskell
+au BufNewFile,BufRead cabal.project setf cabalproject
+au BufNewFile,BufRead $HOME/.cabal/config setf cabalconfig
+au BufNewFile,BufRead cabal.config setf cabalconfig
" Haste
au BufNewFile,BufRead *.ht setf haste
@@ -2042,12 +2051,14 @@ au BufNewFile,BufRead bzr_log.* setf bzr
" Bazel build file
if !has("fname_case")
- au BufNewFile,BufRead *.BUILD,BUILD setf bzl
+ au BufNewFile,BufRead *.BUILD,BUILD setf bzl
endif
" BIND zone
au BufNewFile,BufRead */named/db.*,*/bind/db.* call s:StarSetf('bindzone')
+au BufNewFile,BufRead cabal.project.* call s:StarSetf('cabalproject')
+
" Calendar
au BufNewFile,BufRead */.calendar/*,
\*/share/calendar/*/calendar.*,*/share/calendar/calendar.*
diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim
index af8482bdbe..ed75bda7a5 100644
--- a/src/nvim/testdir/test_filetype.vim
+++ b/src/nvim/testdir/test_filetype.vim
@@ -86,6 +86,8 @@ let s:filename_checks = {
\ 'bzr': ['bzr_log.any'],
\ 'c': ['enlightenment/file.cfg', 'file.qc', 'file.c'],
\ 'cabal': ['file.cabal'],
+ \ 'cabalconfig': ['cabal.config'],
+ \ 'cabalproject': ['cabal.project', 'cabal.project.local'],
\ 'calendar': ['calendar'],
\ 'catalog': ['catalog', 'sgml.catalogfile'],
\ 'cdl': ['file.cdl'],