Ⅰ. 插件描述
Allows you to have per-project settings files for vim.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'ralt/psettings'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'ralt/psettings'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'ralt/psettings'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/ralt/psettings
Ⅳ. 文档说明
psettings aka Project Settings
Description
This plugin allows you to have different vim settings for each project.
If you're working with different coding standards (X project has shiftwidth 2,
Y project has shiftwidth 4, etc), it can become cumbersome to always work with
vim.
This project solves this.
Usage
Put a .psettings file at the root of your project. In this file, put the
following line:
php:
module:
install:
inc:
Drupal
That is, if you want to use the Drupal project settings for the following
extensions: .php, .module, .install and .inc. You can also use the *
wildcard to have a psetting applied to all your files.
The default settings are in the settings/ folder of this plugin. You can add
your own settings folder by putting the following in your vimrc:
let g:psettings_custom_path = '/your/path/to/settings/'
If a settings file is found in both folders, both will be used.
The names you put in the .psettings file must match the filename of the
settings file, less the .vim extension.
You can put several project settings in your .psettings file, each settings
file will be read sequentially. This allows you to have one "major" settings
file(for example, all the projects in the PHP language), and several "minor"
settings modes (Drupal projects, Symfony projects, Zend projects, etc).
Basically, for the following .psettings file:
*:
Something
php:
PHP
js:
JavaScript
css:
CSS
The following commands will be executed:
au BufNewFile,BufRead *.* :call Psettings("Something")
au BufNewFile,BufRead *.php :call Psettings("PHP")
au BufNewFile,BufRead *.js :call Psettings("JavaScript")
au BufNewFile,BufRead *.css :call Psettings("CSS")
If you simply want to run a project settings, you can also run the following
command:
:call Psettings("Drupal")
Roadmap
See the issue queue.
Contributors
License
MIT License.