• Stars
    star
    3,101
  • Rank 14,497 (Top 0.3 %)
  • Language
    Vim Script
  • License
    Other
  • Created about 13 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

EditorConfig plugin for 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:

Install with the archive

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 4 sub-directories in this runtime directory now: "autoload", "doc", "ftdetect" and "plugin".

Install as Vim8 plugin

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

Install with pathogen

Use pathogen (the git repository of this plugin is https://github.com/editorconfig/editorconfig-vim.git)

Install with Vundle

Use Vundle by adding to your .vimrc Vundle plugins section:

Plugin 'editorconfig/editorconfig-vim'

Then call :PluginInstall.

Install with vim-plug

Use vim-plug by adding to your .vimrc in your plugin section:

Plug 'editorconfig/editorconfig-vim'

Source your .vimrc by calling :source $MYVIMRC.

Then call :PlugInstall.

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)

Selected Options

The supported options 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 for a specific filetype

You can disable this plugin for a specific buffer by setting b:EditorConfig_disable. Therefore, you can disable the plugin for all buffers of a specific filetype. For example, to disable EditorConfig for all git commit messages (filetype gitcommit):

au FileType gitcommit let b:EditorConfig_disable = 1

Disable rules

In very rare cases, you might need 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. This is not recommended, but you can:

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 guidelines!

More Repositories

1

editorconfig

EditorConfig universal issue tracker and wiki
3,082
star
2

editorconfig-emacs

EditorConfig plugin for Emacs
Emacs Lisp
724
star
3

editorconfig-visualstudio

EditorConfig Visual Studio Addin
C#
352
star
4

editorconfig-core-c

EditorConfig core library written in C (for use by plugins supporting EditorConfig parsing)
C
292
star
5

editorconfig-jetbrains

A JetBrains IDE plugin supporting the EditorConfig standard
Java
292
star
6

editorconfig-core-js

EditorConfig Core library and command line utility written in JavaScript
TypeScript
266
star
7

editorconfig.github.com

Configuration file format for defining coding styles in shared projects
HTML
265
star
8

editorconfig-notepad-plus-plus

EditorConfig plugin for Notepad++
C++
186
star
9

editorconfig-core-go

EditorConfig Core written in Go
Go
129
star
10

editorconfig-core-py

Clone of EditorConfig core written in Python
Python
90
star
11

specification

Specification of EditorConfig file format
Python
83
star
12

editorconfig-core-net

EditorConfig Core library and command line utility written in C# for .NET/Mono http://editorconfig.org
C#
70
star
13

editorconfig-core-java

Clone of EditorConfig core written in Java
Java
61
star
14

editorconfig-gedit

EditorConfig plugin for Gedit
Python
54
star
15

editorconfig-geany

EditorConfig plugin for Geany
C
45
star
16

editorconfig-qtcreator

EditorConfig Plugin for QtCreator
C++
40
star
17

editorconfig-core-ruby

Clone of EditorConfig core written in Ruby
Ruby
27
star
18

editorconfig-core-test

Testings for EditorConfig Core
CMake
25
star
19

editorconfig-defaults

24
star
20

editorconfig-jedit

EditorConfig plugin for jEdit
Java
16
star
21

editorconfig-plugin-tests

Tests for EditorConfig plugins
Python
16
star
22

editorconfig-core-lua

EditorConfig Core bindings for Lua
CMake
15
star
23

live-demo

Work in progress: EditorConfig in-browser live demo
JavaScript
13
star
24

editorconfig-textadept

EditorConfig plugin for Textadept
Lua
11
star
25

utilities

Utilities for EditorConfig development
Ruby
11
star
26

editorconfig-codeblocks

EditorConfig plugin for Code::Blocks
C++
11
star
27

editorconfig-core-qt

EditorConfig core written for Qt
C++
10
star
28

docs.editorconfig.org

EditorConfig C Core library documentation
JavaScript
10
star
29

editorconfig-core-java-binding

EditorConfig Core Java Binding
Java
8
star
30

editorconfig-vote

The issue tracker is for voting purpose only. Only @editorconfig/board-member members can comment.
4
star
31

javadocs.editorconfig.org

EditorConfig library Java API documentation
CSS
3
star