mirror of
https://github.com/keith/swift.vim.git
synced 2025-12-12 20:35:53 +01:00
24 lines
529 B
VimL
24 lines
529 B
VimL
if empty($OUTPUT_FILE)
|
|
echom "Error: Environment variable OUTPUT_FILE is not set."
|
|
cquit! 1
|
|
endif
|
|
|
|
set nocompatible
|
|
set runtimepath^=$PWD
|
|
filetype plugin indent on
|
|
|
|
syntax on
|
|
augroup swiftIndent
|
|
autocmd!
|
|
autocmd BufRead,BufNewFile *.swift setlocal shiftwidth=4 expandtab
|
|
augroup END
|
|
|
|
" Apply autoindent, save and quit.
|
|
function! s:RemoveWhitespaceAndReindent()
|
|
silent %s/^\s\+//
|
|
normal gg=G
|
|
execute 'write ' . fnameescape($OUTPUT_FILE)
|
|
quit!
|
|
endfunction
|
|
autocmd BufReadPost * call s:RemoveWhitespaceAndReindent()
|