Add new colorschemes to runtime

This commit is contained in:
Zachary Yedidia 2016-06-23 08:39:26 -04:00
parent 00309a2800
commit 91dd06fd9e
4 changed files with 150 additions and 71 deletions

View file

@ -15,7 +15,7 @@ type Colorscheme map[string]tcell.Style
// The current colorscheme
var colorscheme Colorscheme
var preInstalledColors = [3]string{"default", "solarized", "solarized-tc"}
var preInstalledColors = []string{"default", "solarized", "solarized-tc", "atom-dark-tc", "monokai-tc"}
// InitColorscheme picks and initializes the colorscheme when micro starts
func InitColorscheme() {

View file

@ -51,6 +51,7 @@ var preInstalledSynFiles = []string{
"erb",
"fish",
"fortran",
"gdscript",
"gentoo-ebuild",
"gentoo-etc-portage",
"git-commit",
@ -138,6 +139,7 @@ func LoadSyntaxFiles() {
// This involves finding the regex for syntax and if it exists, the regex
// for the header. Then we must get the text for the file and the filetype.
func LoadSyntaxFilesFromDir(dir string) {
colorscheme = make(Colorscheme)
InitColorscheme()
// Default style

File diff suppressed because one or more lines are too long

View file

@ -155,12 +155,20 @@ Here are the options that you can set:
colorschemes:
* default: this is the default colorscheme.
* solarized: this is the solarized colorscheme (used in the screenshot).
You should have the solarized color palette in your terminal to use it.
* solarized-tc: this is the solarized colorscheme for true color, just
make sure your terminal supports true color before using it and that the
MICRO_TRUECOLOR environment variable is set to 1 before starting micro.
* monokai-tc: this is the monokai colorscheme. It requires true color to
look perfect, but the 256 color approximation looks good as well.
* atom-dark-tc: this colorscheme is based off of Atom's "dark" colorscheme.
It requires true color to look good.
* `tabsize`: sets the tab size to `option`