diff options
author | Ethan Schoonover <es@ethanschoonover.com> | 2011-04-09 21:50:39 -0700 |
---|---|---|
committer | Ethan Schoonover <es@ethanschoonover.com> | 2011-04-09 21:50:39 -0700 |
commit | c669333929b35d01deb3bdaaf655357b8921a0a3 (patch) | |
tree | a476dc44cfcf2f4db42c8cb7c98e146fb6fc2d74 | |
parent | d93e97f05d7ea7fd8c7d7b79c2b6d522e1ffce1d (diff) | |
download | vim-colors-solarized-c669333929b35d01deb3bdaaf655357b8921a0a3.tar.gz |
[vim] added au cmd to check if vim has switch from term to gui mode and call CS
-rw-r--r-- | colors/solarized.vim | 22 |
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 "}}} |