sponsor Vim development Vim logo Vim Book Ad

gui2term.py : Python script that add 256-color terminal support to GUI only colorschemes.

 script karma  Rating 70/24, Downloaded by 2621    Comments, bugs, improvements  Vim wiki

created by
lilydjwg
 
script type
utility
 
description
Requirement: python3 for 2.0+. However, it should not be hard to make it work under Python 2 if you are familiar with Python (you can try the `3to2` command).

Usage:
invoke it like this in commandline:
  ./gui2term.py sourcefile newfile
or
  python3 gui2term.py sourcefile newfile

Note:
* It searches and processes lines in a vim colorscheme that seems like a normal highlight command, so it does not work with all the colorscheme.
* Some GUI only colorschemes may use the default scheme if it found itself under a terminal. You need to manually remove these lines.
* For some colors, the output is rather bad.

gui2term is part of winterpy on github: https://github.com/lilydjwg/winterpy/tree/master/pyexe/gui2term.py
 
install details
Put the file wherever you like.

To make it recognize color names, the script needs the rgb.txt file (:help rgb.txt). It will check the current working directory and where it lies for it. If there is a 'locate' command on your system, it will also try to use that. The file may be found where you installed Vim; it may also be shipped with X window, emacs and some other packages.
 

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
gui2term.py 3.0.3 2011-08-06 7.0 lilydjwg when trying 'locate' command, add '-e' option and read only one line.
gui2term.py 3.0.2 2011-06-22 7.0 lilydjwg when finding rgb.txt, try 'locate' command last.
gui2term.py 3.0.1 2011-06-17 7.0 lilydjwg - use 'NONE' instead of 'none' as the later is reported to be invalid color names sometimes
- sorted highlight args so that it is easy to remove what has been added or modified
gui2term.py 3.0 2011-06-14 7.0 lilydjwg * try to use `locate' to find rgb.txt
* improve color matching algorithm (thanks to Eric Pruitt for the idea)
* other small fixes
gui2term.py 2.0 2011-01-14 7.0 lilydjwg - Rewrite so that when there are already cterm definitions, they will be updated.
- Avoid Chinese output.
- Switch to Python 3.
gui2term.py 1.0 2009-09-06 6.0 lilydjwg Initial upload
ip used for rating: 54.81.124.198

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.
   
SourceForge.net Logo