vim-projectlocal


Ⅰ. 插件描述

Per-project .vimrc files.

Ⅱ. 基本信息

创建日期:  2012-09-07
使用用户:  20
Github星:  35
插件作者:  Kris Jenkins

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# ProjectLocal - .vimrc files for your project

ProjectLocal lets you set up project-specific .vimrc files.

When you edit a file, it searches up through your directories, looking for a .vimrc file. It tries to guess the project's root by looking for a .git/.hg folder on the way up.

Status

Stable. Feature-complete, so there's no new development, but any bugs will be fixed if found.

Installation

  • Install Pathogen. (You're already using Pathogen, right?)
  • Clone this project into ~/.vim/bundle/vim-projectlocal.
  • Add a .vimrc to the root of your project.

Customization

ProjectLocal will also look for .vimrc files in your subdirectories. For example:

.vimrc              => Affects all files in the project.
resources/.vimrc    => Affects any file under resources/
resources/js/.vimrc => Affects any file under resources/js/

Files are processed in top-down order.

By default, directories called .git or .hg mark the root of a project. You can customize this by changing the setting in your main ~/.vimrc:

" The root is considered to be the first directory containing an item with one of these names:
let g:projectlocal_project_markers = ['.git', '.hg', '.project', 'README.md']

Credits

Thanks to Steve Losh for his excellent guide to Vimscript, Learn Vimscript the Hard Way, and VimNinjas for the inspiration.

添加新评论