Ⅰ. 插件描述
Create and set cache file directories easilyⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/auto-cache-dirs-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/auto-cache-dirs-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/auto-cache-dirs-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone
Ⅳ. 文档说明
This plugin attempts to intelligently set and create the directories for the 'backupdir', 'directory', and 'undodir' options in a sensible root location. It chooses the root directory by trying each of these in succession:
- If g:auto_cache_dirs_root is set when the plugin loads, it uses that.
- If the environment variable $XDG_CONFIG_HOME is set, it uses that, with "/vim" appended.
- If the system is Unix, it uses ~/.cache/vim.
- Otherwise, it uses the first element of the value of 'runtimepath'.
The plugin tries hard to create the directories, trying Vim's native mkdir() function if available first, and falling back to shell commands otherwise. At the time of writing, the latter only works for Unix and Windows. If you use another system and would like to see a routine for it added, please send a patch through.
If the directory can be created, it sets the relevant option feature flag and prepends the path to that option path list.
If the directory cannot be created, a warning is printed, and the options as the plugin found them are left untouched.