Ⅰ. 插件描述

Create and set cache file directories easily

Ⅱ. 基本信息

创建日期:  2018-05-31
使用用户:  0
Github星:  0
插件作者:  Tom Ryder

Ⅲ. 安装方法


Plugin '/auto-cache-dirs-vim'
… 然后在Vim中运行以下命令:
:source %

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


NeoBundle '/auto-cache-dirs-vim'
… 然后在Vim中运行以下命令:
:source %


Plug '/auto-cache-dirs-vim'
… 然后在Vim中运行以下命令:
:source %


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.