perdirvimrc: Autoload vimrc files per di


Ⅰ. 插件描述

Loads vimrc files that are above the opened file in the directory tree

Ⅱ. 基本信息

创建日期:  2009-09-20
使用用户:  1
Github星:  1
插件作者:  Wolfgang Plaschg

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin '/perdirvimrc-autoload-vimrc-files-per-di'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle '/perdirvimrc-autoload-vimrc-files-per-di'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug '/perdirvimrc-autoload-vimrc-files-per-di'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/vim-scripts/perdirvimrc--Autoload-vimrc-files-per-di

Ⅳ. 文档说明

This script loads Vim configuration files at startup beginning
from the root directory down to the current working directory.

This is useful when you want to to set up a specific configuration that
is only loaded when you edit files within a certain directory.

Let's look at a common situation. To configure Vim depending on your
project, your tree would look like this:

~/projects  .................................. Your programming projects
~/projects/.vim  .......................... Vim settings for all your projects
~/projects/c-projects  ................ Your C projects
~/projects/c-projects/.vim  ........ Vim settings for your C projects
~/projects/php-projects  ........... Your PHP projects
~/projects/php-projects/.vim  ... Vim settings for your PHP projects

When you open the file ~/projects/c-projects/main.c the plugin loads
this files in the given order:

~/projects/.vim
~/projects/c-projects/.vim

The scripts autoloads files with the name

      _vimrc
      _vim
      .vimrc
      .vim

添加新评论