Ⅰ. 插件描述
Vim Haskell Brittany integration pluginⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'meck/vim-brittany'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'meck/vim-brittany'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'meck/vim-brittany'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/meck/vim-brittany
Ⅳ. 文档说明
# vim-brittany
This is an adaption of vim-stylishask by alx741.
It's basically a search and replace.
Vim-brittany integrates with brittany so every time
you save a Haskell source file it gets automatically prettified.
Simply using :%!brittany replaces your whole source file with an error message
from brittany when you happen to have a syntax error in your code, this
plugin manages that annoyance.
Installation
Compatible with Vundle, Pathogen, Vim-plug.
Usage
By default, vim-brittany will format your code automatically when saving a
Haskell source file, but you can use the :Brittany command at any time to
format the current file.
To apply vim-brittany on a range, either write the range manually or
visually select the desired code and then invoke :Brittany.
Use :BrittanyEnable, :BrittanyDisable, :BrittanyToggle to enable, disable, or
toggle running brittany on save.
Configuration
Trigger brittany when saving (default = 1):
g:brittany_on_save = 1Brittany configuration file to use (default = "" == Use default ~/.brittany/config.yaml):
g:brittany_config_file = "/path/to/config.yaml"