sponsor Vim development Vim logo Vim Book Ad

localColorSchemes.vim : Local color schemes

 script karma  Rating -1/3, Downloaded by 1754  Comments, bugs, improvements  Vim wiki

created by
Salman Halim
 
script type
utility
 
description
This allows the use of buffer-specific color schemes.  Every time one moves from one buffer to another, the color scheme will change to the specified one; setting the variable b:colorscheme inside an ftplugin will allow for all files of a particular type to have that scheme (such as morning for vim files, peachpuff for Java files etc.).

To use, there are three mappings, all starting with <Leader>:  sl prompts and sets a local color scheme, sg does the same for a global color scheme and rl removes any locally set color schemes.  There is also a convenience command called Colorscheme which behaves just like the regular colorscheme command (except for the command-line completion); it also modifies the global colorscheme name.

I have placed the value of the colorscheme names my 'statusline' option so I can tell which colors are being used -- and I stick either a g: or b: before the name so I know if it's a local or global setting.  (Hint:  use a non <SID> version of GetVar -- included within).

The only problem I know of is that syntax settings set by plugins (such as the excellent ShowMarks) get reset every time a color scheme is changed (since they start with a syntax clear).
 
install details
Pop it into your plugin directory.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
localColorSchemes.vim 1.2 2003-09-22 6.0 Salman Halim Added Removewindowcolors  and Setwindowcolors to set  window-specific colors (along with mappings).
localColorSchemes.vim 1.1 2003-09-22 6.0 Salman Halim Removed internal GetVar; now has a dependence on getVar.vim (http://www.vim.org/scripts/script.php?script_id=353).
localColorSchemes.vim 1 2002-07-24 6.0 Salman Halim Initial upload
ip used for rating: 18.118.227.69

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github