aboutsummaryrefslogtreecommitdiff
path: root/vim/ftdetect/python.vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim/ftdetect/python.vim')
-rw-r--r--vim/ftdetect/python.vim9
1 files changed, 9 insertions, 0 deletions
diff --git a/vim/ftdetect/python.vim b/vim/ftdetect/python.vim
new file mode 100644
index 00000000..5c4a4a6f
--- /dev/null
+++ b/vim/ftdetect/python.vim
@@ -0,0 +1,9 @@
+" Python files
+autocmd BufNewFile,BufRead
+ \ *.py
+ \ setfiletype python
+autocmd BufNewFile,BufRead
+ \ *
+ \ if getline(1) =~# '\m^#!.*\<python[23]\?\>'
+ \ | setfiletype python
+ \ | endif