Partially import github.com/keith/swift.vim
This commit is contained in:
parent
f8edb175fa
commit
1c0cd8a576
4 changed files with 615 additions and 0 deletions
12
vim/ftdetect/swift.vim
Normal file
12
vim/ftdetect/swift.vim
Normal file
|
@ -0,0 +1,12 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue