Ⅰ. 插件描述
Easily have settings that apply only to files under a given directoryⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/directory-specific-settings'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/directory-specific-settings'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/directory-specific-settings'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/Directory-specific-settings
Ⅳ. 文档说明
This is a very simple plugin that allows for directory tree-specific vim settings.
For example, I prefer to indent with spaces, but one of the code bases I'm working on uses TABs for indentation. So, instead of mucking with settings and going back and forth, I just create a file called ".vimdir" at the top of that tree and put in some code like this:
setlocal noexpandtab
And that's it! Every file I edit under that directory will use that setting!
For every file edited, it searches upward from that file's directory for a file named '.vimdir' and sources it. So, any arbitrary code can be put into the .vimdir file. But you should take care to ensure that the code applies only to that file and doesn't have any global side-effects. So, for example, always use 'setlocal'.
This plugin is very similar to vimscript #441.