vim-stylefmt


Ⅰ. 插件描述

Format your stylesheets using stylefmt inside Vim

Ⅱ. 基本信息

创建日期:  2015-08-14
使用用户:  16
Github星:  35
插件作者:  Antoine Lehurt

Ⅲ. 安装方法

使用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 stylefmt

Then install the plugin:

  • Manual installation:

    • Copy the files to your .vim/plugin directory
  • Pathogen

    • cd ~/.vim/bundle && git clone git://github.com/kewah/vim-stylefmt.git
  • Vundle

    • Add Plugin 'kewah/vim-stylefmt' to .vimrc
    • Run :PluginInstall
  • NeoBundle

    • Add NeoBundle 'kewah/vim-stylefmt' to .vimrc
    • Run :NeoBundleInstall
  • vim-plug

    • Add Plug 'kewah/vim-stylefmt' to .vimrc
    • Run :PlugInstall

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

添加新评论