mirror of
https://github.com/amix/vimrc
synced 2025-07-10 03:25:00 +08:00
add cocoa.vim & swift.vim
This commit is contained in:
12
sources_non_forked/swift.vim/ftdetect/swift.vim
Normal file
12
sources_non_forked/swift.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
|
Reference in New Issue
Block a user