configs  swift.vim at [62859f3e4c]

File vim/ftdetect/swift.vim artifact a1c76113b9 part of check-in 62859f3e4c


autocmd BufNewFile,BufRead *.swift 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