aboutsummaryrefslogtreecommitdiff
path: root/runtime/scripts.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/scripts.vim')
-rw-r--r--runtime/scripts.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/runtime/scripts.vim b/runtime/scripts.vim
index e41405a6c5..2d8bfdcb05 100644
--- a/runtime/scripts.vim
+++ b/runtime/scripts.vim
@@ -11,6 +11,10 @@
" 'ignorecase' option making a difference. Where case is to be ignored use
" =~? instead. Do not use =~ anywhere.
+" Only run when using legacy filetype
+if !exists('g:do_legacy_filetype')
+ finish
+endif
" Only do the rest when the FileType autocommand has not been triggered yet.
if did_filetype()
@@ -202,6 +206,14 @@ if s:line1 =~# "^#!"
elseif s:name =~# 'gforth\>'
set ft=forth
+ " Icon
+ elseif s:name =~# 'icon\>'
+ set ft=icon
+
+ " Guile
+ elseif s:name =~# 'guile'
+ set ft=scheme
+
endif
unlet s:name
@@ -406,6 +418,12 @@ else
elseif s:line1 =~# '^#.*by RouterOS.*$'
set ft=routeros
+ " Sed scripts
+ " #ncomment is allowed but most likely a false positive so require a space
+ " before any trailing comment text
+ elseif s:line1 =~# '^#n\%($\|\s\)'
+ set ft=sed
+
" CVS diff
else
let s:lnum = 1