Independence


Ⅰ. 插件描述

A vim plugin for loading (git) project specific vim settings

Ⅱ. 基本信息

创建日期:  2012-01-16
使用用户:  8
Github星:  9
插件作者:  Andy Dawson

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

Vim Independence

This vim plugin allows you to load (git) project specific .vimrc files

Installation

I recommend using Vim Pathogen

Therefore:

cd .vim/bundle
git clone git://github.com/AD7six/vim-independence.git

Alternatively - simply put the file independence.vim in your plugin folder directly

Usage

The plugin is automatic; it will look for and load all .vimrc files found from the git project
root to the buffer's folder. When not in a git project, no action is taken.

For example, let's consider that you use the Syntastic
plugin, and most of your projects are php. The default standard for syntastic to check code against
is the Zend standard - a reasonable default. If all of your projects follow the Zend standard, that's

  1. If all of your projects follow a different standard - that's also fine, you can simply define
    g:syntastic_phpcs_conf in your ~/.vimrc file and the syntastic plugin will take that config.

If you need to follow more than one standard using vim independence that becomes easy:

in ~/somepearproject create ~/somepearproject/.vimrc with the following contents:

let g:syntastic_phpcs_conf = '--standard=Pear`

in ~/somesymfony2project create ~/somesymfony2project/.vimrc with the following contents:

let g:syntastic_phpcs_conf = '--standard=Symfony2`

Etc.

Gotchas

As you may deduce from the above example, if you modify a global variable in a project-specific
.vimrc file - those settings will persist for all subsequent buffers you open.

Changelog

  • 0.1.0 Intial release
  • 0.2.0 Load all ".vimrc" files from the git project root down to the buffer's folder

添加新评论