Files
vim-swift-mirror/ftdetect/swift.vim
2014-10-20 14:28:09 -07:00

13 lines
241 B
VimL

autocmd BufNewFile,BufRead *.swift setfiletype swift
autocmd BufRead * call s:Swift()
function! s:Swift()
if !empty(&filetype)
return
endif
let line = getline(1)
if line =~ "^#!.*swift"
setfiletype swift
endif
endfunction