Skip to content

Commit 277771c

Browse files
author
Benji Fisher
committed
Do something reasonable for foo.twig.twig.
1 parent 69141cd commit 277771c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

filetype.vim

+4-6
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ function! s:Setf(filename)
1919

2020
if !strlen(&ft)
2121
" Default to HTML twig template.
22-
let b:main_syntax = 'html'
23-
execute prefix 'setf html.twig'
24-
elseif &ft !~ '\<twig\>'
25-
let b:main_syntax = &syntax
26-
let &ft .= '.twig'
27-
endif
22+
let ft = 'html.twig'
23+
else
24+
let ft = &ft . (&ft =~ '\<twig\>' ? '' : '.twig')
2825
endif
26+
execute prefix 'set filetype=' . ft
2927
endfun

0 commit comments

Comments
 (0)