config

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Color

type Color struct {
	FG      string
	BG      string
	Attrs   []string
	Clobber bool
}

Color defines background/forground color and attributes for text. The 'Clobber' bool says to color this pattern even if it is nested within another.

func (Color) Dup

func (color Color) Dup() Color

Dup deep copies a Color struct.

type Config

type Config struct {
	TabString     string
	TabString_set bool

	TabWidth     int
	TabWidth_set bool

	AutoTab     bool
	AutoTab_set bool

	TabDetect     bool
	TabDetect_set bool

	FmtCmd     string
	FmtCmd_set bool

	Parent      string
	ExtMap      map[string]string
	SyntaxRules map[string]Color
	FileConfigs map[string]Config
}

Config holds all configuration data. It will be read in from a config file. Elementary values each have a boolean *_set variable to mark a variable as set.

func CreateConfig

func CreateConfig() Config

func Read

func Read(paths ...string) Config

Read the configuration file(s).

func (Config) Dup

func (config Config) Dup() Config

Dup deep copies a Config struct.

func (Config) ForExt

func (config Config) ForExt(ext string) Config

ForExt tailors a config for a specific file extension.

func (Config) Merge

func (config Config) Merge(other Config) Config

Merge a config into this config.

func (Config) MergeParent

func (config Config) MergeParent(level int) Config

MergeParent merges the parent config into the child config. It does this recursively.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL