diff --git a/.gitignore b/.gitignore index 0dcb6bb5..4d6ed1d8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ doc/tags -Powerline.cache +*.cache diff --git a/README.rst b/README.rst index 5cfc9cdb..62646f31 100644 --- a/README.rst +++ b/README.rst @@ -28,13 +28,6 @@ instructions. .. _Pathogen: https://github.com/tpope/vim-pathogen .. _Vundle: https://github.com/gmarik/vundle -Important information about caching ------------------------------------ - -Powerline caches the statuslines by default to improve startup time. -**Please remember to clear the cache after changing any settings!** Run -``:PowerlineClearCache`` and restart vim to clear the cache. - Screenshots ----------- @@ -91,7 +84,7 @@ I'm unable to patch my font, what should I do? The Syntastic/Fugitive statusline flags don't work! These flags should work without any configuration. If you installed either plugin after Powerline, you'll have to clear the cache using - ``:PowerlineClearCache``. + ``:PowerlineClearCache`` and restart vim. The colors are weird in the default OS X Terminal app! The default OS X Terminal app is known to have some issues with the diff --git a/doc/Powerline.txt b/doc/Powerline.txt index ed8b8fe9..1d810102 100644 --- a/doc/Powerline.txt +++ b/doc/Powerline.txt @@ -89,11 +89,13 @@ It's recommended that you enable the cache, as this dramatically improves vim startup time after the cache file has been generated (the plugin usually loads within ~100ms without the cache and ~1ms with the cache). -Note: You need to clear the cache after changing any Powerline settings. Run -":PowerlineClearCache" to clear the cache and restart vim for the changes to -take effect. +Note: The default cache filename includes the current theme, colorscheme and +symbol settings in order to tie the cache file your current configuration, so +the cache file will be regenerated when you change any settings. This may +leave several old cache files in your vim folder, and these may safely be +deleted. -Defaults: "/Powerline.cache" +Defaults: "/Powerline___.cache" ------------------------------------------------------------------------------ 4.2 Powerline_cache_enabled *Powerline_cache_enabled* @@ -124,9 +126,6 @@ Symbols can be inserted into statuslines by using the following variables: Default: "compatible" -Note: You'll need to delete the |Powerline_cache_file| after changing this -option for the changes to take effect. - ------------------------------------------------------------------------------ 4.3.1 Compatible symbols *Powerline-symbols-compatible* diff --git a/plugin/Powerline.vim b/plugin/Powerline.vim index ab0f4010..81dd3678 100644 --- a/plugin/Powerline.vim +++ b/plugin/Powerline.vim @@ -15,7 +15,6 @@ \ 'theme' : 'distinguished' \ , 'colorscheme' : 'distinguished' \ , 'symbols' : 'compatible' - \ , 'cache_file' : simplify(expand(':p:h') . '/../Powerline.cache') \ , 'cache_enabled': 1 \ }) @@ -23,6 +22,15 @@ exec printf('let g:Powerline_%s = %s', key, string(value)) endif endfor + + if ! exists('g:Powerline_cache_file') + exec 'let g:Powerline_cache_file = '. string(printf('%s/Powerline_%s_%s_%s.cache' + \ , simplify(expand(':p:h') .'/..') + \ , g:Powerline_theme + \ , g:Powerline_colorscheme + \ , g:Powerline_symbols + \ )) + endif " }}} " Autocommands {{{ augroup Powerline