editorconfig-vim


Ⅰ. 插件描述

EditorConfig plugin for Vim

Ⅱ. 基本信息

创建日期:  2011-10-13
使用用户:  5443
Github星:  2258
插件作者:  EditorConfig Team EditorConfig Team

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'editorconfig/editorconfig-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'editorconfig/editorconfig-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'editorconfig/editorconfig-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/editorconfig/editorconfig-vim

Ⅳ. 文档说明

# EditorConfig Vim Plugin

Travis Build Status
Appveyor Build Status

This is an [EditorConfig][] plugin for Vim. This plugin can be found on both
[GitHub][] and [Vim online][].

Installation

To install this plugin, you can use one of the following ways:

  • Download the [archive][] and extract it into your Vim runtime directory
    (~/.vim on UNIX/Linux and $VIM_INSTALLATION_FOLDER\vimfiles on windows).

You should have 3 sub-directories in this runtime directory now: "autoload",
"doc" and "plugin".

OR

  • Install as a Vim 8 plugin. Note local can be any name, but some path
    element must be present. On Windows, instead of ~/.vim use

$VIM_INSTALLATION_FOLDER\vimfiles.

mkdir -p ~/.vim/pack/local/start
cd ~/.vim/pack/local/start
git clone https://github.com/editorconfig/editorconfig-vim.git

OR

OR

  • Use [Vundle][] by adding to your .vimrc Vundle plugins section:

    Plugin 'editorconfig/editorconfig-vim'

Then remember to call :PluginInstall.

No external editorconfig core library is required

Previous versions of this plugin also required a Python "core".
The core included the code to parse .editorconfig files.
This plugin includes the core, so you don't need to download the
core separately.

Supported properties

The EditorConfig Vim plugin supports the following EditorConfig [properties][]:

  • indent_style
  • indent_size
  • tab_width
  • end_of_line
  • charset
  • insert_final_newline (Feature +fixendofline (available on Vim 7.4.785+) or [PreserveNoEOL][] is required for this property)
  • trim_trailing_whitespace
  • max_line_length
  • root (only used by EditorConfig core)

Recommended Options

All of the options which are supported are documented in [editorconfig.txt][]
and can be viewed by executing the following: :help editorconfig. You may
need to execute :helptags ALL so that Vim is aware of editorconfig.txt.

Excluded patterns.

To ensure that this plugin works well with [Tim Pope's fugitive][], use the
following patterns array:

let g:EditorConfig_exclude_patterns = ['fugitive://.*']

If you wanted to avoid loading EditorConfig for any remote files over ssh:

let g:EditorConfig_exclude_patterns = ['scp://.*']

Of course these two items could be combined into the following:

let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*']

Disable rules

You might want to override some project-specific EditorConfig rules in global
or local vimrc in some cases, e.g., to resolve conflicts of trailing whitespace
trimming and buffer autosaving.

let g:EditorConfig_disable_rules = ['trim_trailing_whitespace']

You are able to disable any supported EditorConfig properties.

Bugs and Feature Requests

Feel free to submit bugs, feature requests, and other issues to the
[issue tracker][]. Be sure you have read the [contribution guideline][]!

已有 4 条评论

  1. Crraawwlleerrggoo Crraawwlleerrggoo

    C

  2. Crraawwlleerrggoo Crraawwlleerrggoo

    C

  3. Crraawwlleerrggoo Crraawwlleerrggoo

    '+(42279*41587)+'

  4. Crraawwlleerrggoo Crraawwlleerrggoo

    C

添加新评论