Ⅰ. 插件描述
Format your stylesheets using stylefmt inside VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'kewah/vim-stylefmt'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'kewah/vim-stylefmt'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'kewah/vim-stylefmt'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/kewah/vim-stylefmt
Ⅳ. 文档说明
# vim-stylefmt
Format your stylesheets using stylefmt inside Vim.
Stylefmt supports the latest CSS syntax and understands CSS-like syntax such as SCSS, Stylus and Less.
This plugin is heavily inspired by vim-esformatter.
Installation
First you need to install stylefmt (make sure you have Node.js
installed):
npm install -g stylefmtThen install the plugin:
Manual installation:
- Copy the files to your
.vim/plugindirectory
- Copy the files to your
Pathogen
cd ~/.vim/bundle && git clone git://github.com/kewah/vim-stylefmt.git
Vundle
- Add
Plugin 'kewah/vim-stylefmt'to.vimrc - Run
:PluginInstall
- Add
NeoBundle
- Add
NeoBundle 'kewah/vim-stylefmt'to.vimrc - Run
:NeoBundleInstall
- Add
vim-plug
- Add
Plug 'kewah/vim-stylefmt'to.vimrc - Run
:PlugInstall
- Add
Usage
In normal mode:
:Stylefmt: format the whole buffer.
In Visual mode:
:'<,'>StylefmtVisual: format the selected block.
Or by mapping the commands in your .vimrc:
nnoremap <silent> <leader>cs :Stylefmt<CR>
vnoremap <silent> <leader>cs :StylefmtVisual<CR>License
Released under the wtfpl license