Ⅰ. 插件描述
A Swift checker for Syntastic that works with a single Swift fileⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'thecodedself/syntastic-swift'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'thecodedself/syntastic-swift'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'thecodedself/syntastic-swift'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/thecodedself/syntastic-swift
Ⅳ. 文档说明
# Syntastic Swift
Syntastic Swift works with the syntastic Vim plugin to compile a single Swift file and display any warnings or errors inside Vim.
Installation
Install syntastic using Pathogen:
cd ~/.vim/bundle && \
git clone --depth=1 https://github.com/vim-syntastic/syntastic.gitThen install this syntax checker:
cd ~/.vim/bundle && \
git clone --depth=1 https://github.com/TheCodedSelf/syntastic-swiftUsage
Open a Swift file in Vim and save it. The swift syntax checker will run and provide you with any errors or warnings.
Troubleshooting
Run :SyntasticInfo. You should see the following included in the output:
Available checkers: swift
Currently enabled checkers: swiftIf you don't, then add the following to your .vimrc:
let g:syntastic_aggregate_errors = 1
let g:syntastic_swift_checkers = ['swift']
" If you have other Swift checkers, add them to the above arrayReopen a Swift file and take a look at :SyntasticInfo. If you're still experiencing problems, feel free to make an issue on this repository.