auto_cache_dirs.vim : Create and set cache file directories easily
| script karma
Downloaded by 54
Comments, bugs, improvements
script versions (upload new version)
|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.
|Drop plugin/auto_cache_dirs.vim in your ~/.vim/plugin directory. Add doc/auto_cache_dirs.txt in ~/.vim/doc if you want the help file. Otherwise, use your favourite Vim plugin package manager.|
Click on the package to download.
ip used for rating: 22.214.171.124