Ⅰ. 插件描述
vim plugin for shfmtⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '42wim/vim-shfmt-without-it'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '42wim/vim-shfmt-without-it'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '42wim/vim-shfmt-without-it'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/42wim/vim-shfmt
Ⅳ. 文档说明
# vim-shfmt
Vim plugin for shfmt (based on https://github.com/fatih/vim-hclfmt)
The plugin by default will format *.sh files on save.
Under the hood it uses shfmt to process the
files.
Usage
Save the file or call :ShFmt.
By default vim-shfmt automatically formats *.sh files. You can permanently disable this configuration in your ~/.vimrc as follows:
let g:sh_fmt_autosave = 0
Install
Vim-shfmt follows the standard runtime path structure. For Pathogen just clone
the repo. For other plugin managers add the appropriate lines and execute the
plugin's install command.
git clone https://github.com/42wim/vim-shfmt.git ~/.vim/bundle/vim-shfmt
Plug '42wim/vim-shfmt'
NeoBundle '42wim/vim-shfmt'
Plugin '42wim/vim-shfmt'
If shfmt is not already installed:
go get -u mvdan.cc/sh/cmd/shfmt