aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/autoload/dist/ft.vim4
-rw-r--r--runtime/doc/filetype.txt1
-rw-r--r--src/nvim/testdir/test_filetype.vim9
3 files changed, 12 insertions, 2 deletions
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index 866196a7df..38fe8d4872 100644
--- a/runtime/autoload/dist/ft.vim
+++ b/runtime/autoload/dist/ft.vim
@@ -823,7 +823,9 @@ func dist#ft#FTperl()
endfunc
func dist#ft#FTsys()
- if IsRapid()
+ if exists("g:filetype_sys")
+ exe "setf " .. g:filetype_sys
+ elseif IsRapid()
setf rapid
else
setf bat
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index 5f7c1b57f8..e1b0e88c95 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -153,6 +153,7 @@ variables can be used to overrule the filetype used for certain extensions:
*.pp g:filetype_pp |ft-pascal-syntax|
*.prg g:filetype_prg
*.src g:filetype_src
+ *.sys g:filetype_sys
*.sh g:bash_is_sh |ft-sh-syntax|
*.tex g:tex_flavor |ft-tex-plugin|
*.w g:filetype_w |ft-cweb-syntax|
diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim
index 197a9edb76..85d9a75824 100644
--- a/src/nvim/testdir/test_filetype.vim
+++ b/src/nvim/testdir/test_filetype.vim
@@ -1474,7 +1474,7 @@ endfunc
func Test_sc_file()
filetype on
- " SC file mehtods are defined 'Class : Method'
+ " SC file methods are defined 'Class : Method'
call writefile(['SCNvimDocRenderer : SCDocHTMLRenderer {'], 'srcfile.sc')
split srcfile.sc
call assert_equal('supercollider', &filetype)
@@ -1561,6 +1561,13 @@ func Test_sys_file()
call assert_equal('bat', &filetype)
bwipe!
+ " Users preference set by g:filetype_sys
+ let g:filetype_sys = 'sys'
+ split sysfile.sys
+ call assert_equal('sys', &filetype)
+ unlet g:filetype_sys
+ bwipe!
+
" RAPID header start with a line containing only "%%%",
" but is not always present.
call writefile(['%%%'], 'sysfile.sys')