aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--colors/solarized.vim22
1 files changed, 21 insertions, 1 deletions
diff --git a/colors/solarized.vim b/colors/solarized.vim
index 8e3b0b8..0df0e00 100644
--- a/colors/solarized.vim
+++ b/colors/solarized.vim
@@ -4,7 +4,7 @@
" (see this url for latest release & screenshots)
" License: OSI approved MIT license (see end of this file)
" Created: In the middle of the night
-" Modified: 2011 Apr 07
+" Modified: 2011 Apr 09
"
" Usage "{{{
"
@@ -923,6 +923,25 @@ exe "hi! pandocMetadata" .s:fg_blue .s:bg_none .s:fmt_bold
hi! link pandocMetadataTitle pandocMetadata
"}}}
+" Utility autocommand "{{{
+" ---------------------------------------------------------------------
+" In cases where Solarized is initialized inside a terminal vim session and
+" then transferred to a gui session via the command `:gui`, the gui vim process
+" does not re-read the colorscheme (or .vimrc for that matter) so any `has_gui`
+" related code that sets gui specific values isn't executed.
+"
+" Currently, Solarized sets only the cterm or gui values for the colorscheme
+" depending on gui or terminal mode. It's possible that, if the following
+" autocommand method is deemed excessively poor form, that approach will be
+" used again and the autocommand below will be dropped.
+"
+" However it seems relatively benign in this case to include the autocommand
+" here. It fires only in cases where vim is transferring from terminal to gui
+" mode (detected with the script scope s:vmode variable). It also allows for
+" other potential terminal customizations that might make gui mode suboptimal.
+"
+autocmd GUIEnter * if (s:vmode != "gui") | exe "colorscheme " . g:colors_name "| endif
+"}}}
" License "{{{
" ---------------------------------------------------------------------
"
@@ -946,4 +965,5 @@ hi! link pandocMetadataTitle pandocMetadata
" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
" THE SOFTWARE.
"
+" vim:foldmethod=marker:foldlevel=0
"}}}