From 17ecfbdabcfdf294dae27c506fb68b58175199b5 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Sat, 8 Jun 2019 13:14:56 +0200 Subject: Add s:setf helper, fixes #399 --- ftdetect/polyglot.vim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ftdetect') diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 3fb51075..830b1fb7 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -1,3 +1,9 @@ +function! s:setf(filetype) abort + if &filetype !=# a:filetype + let &filetype = a:filetype + endif +endfunction + " Enable jsx syntax by default if !exists('g:jsx_ext_required') let g:jsx_ext_required = 0 -- cgit v1.2.3