From 5173246a939f1a665d1908c536be6f04e6717ef1 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 3 Aug 2014 03:04:47 +0400 Subject: [PATCH] Add note about automatic vimrc resourcing Ref #297 Ref #296 Closes #213 --- docs/source/troubleshooting.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/source/troubleshooting.rst b/docs/source/troubleshooting.rst index 136c2d67..5174b2d3 100644 --- a/docs/source/troubleshooting.rst +++ b/docs/source/troubleshooting.rst @@ -150,3 +150,28 @@ Prompt is spoiled after completing files in ksh This is exactly why powerline has official mksh support, but not official ksh support. If you know the solution feel free to share it in `powerline bug tracker`_. + +Powerline loses color after editing vimrc +----------------------------------------- + +If your vimrc has something like + +.. code-block:: vim + + autocmd! BufWritePost vimrc :source ~/.vimrc + +to automatically source vimrc after saving it you must then add ``nested`` after +pattern (``vimrc`` in this case): + +.. code-block:: vim + + autocmd! BufWritePost vimrc nested :source ~/.vimrc + +. Alternatively move ``:colorscheme`` command out of the vimrc to the file which +will not be automatically resourced. Observed problem is that when you use +``:colorscheme`` command existing highlighting groups are usually cleared, +including those defined by powerline. To workaround this issue powerline hooks +``Colorscheme`` event, but when you source vimrc with ``BufWritePost`` event, +but without ``nested`` this event is not launched. See also `autocmd-nested +`_ +Vim documentation.