-
-
Save mgwilliams/fee093a5687738d6fd06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ftdetect/sls.vim b/ftdetect/sls.vim | |
index 94295b4..d075bf8 100644 | |
--- a/ftdetect/sls.vim | |
+++ b/ftdetect/sls.vim | |
@@ -1,3 +1,11 @@ | |
-if has("autocmd") | |
- au BufNewFile,BufRead *.sls set filetype=sls | |
-endif | |
+function! DetectSls() | |
+ if !did_filetype() | |
+ if match(getline(1), '^#!py') > -1 | |
+ set ft=python | |
+ else | |
+ set ft=sls | |
+ endif | |
+ endif | |
+endfunction | |
+ | |
+:au BufNewFile,BufRead *.sls call DetectSls() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment