mirror of
https://github.com/keith/swift.vim.git
synced 2025-12-17 12:00:25 +01:00
14 lines
305 B
VimL
14 lines
305 B
VimL
autocmd BufNewFile,BufRead *.swift set filetype=swift
|
|
autocmd BufNewFile,BufRead *.swiftinterface set filetype=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
|