config

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultSectionLines added in v0.7.0

func DefaultSectionLines() [][]string

DefaultSectionLines returns the default multi-line section layout This is the single source of truth for default sections

func DefaultSections

func DefaultSections() []string

DefaultSections returns the default sections as a flat list (for backwards compatibility)

func Init

func Init(dir string) error

Init creates a new project config file

func InitGlobal

func InitGlobal() error

InitGlobal creates a new global config file

func PluginsDir

func PluginsDir() string

PluginsDir returns the path to the plugins directory

Types

type Config

type Config struct {
	ConfigVersion     string         `json:"configVersion,omitempty"` // Tracks which migrations have been applied
	Icon              string         `json:"icon,omitempty"`
	Sections          any            `json:"sections,omitempty"` // Can be []string or [][]string
	Plugins           map[string]any `json:"plugins,omitempty"`
	AutocompactBuffer *float64       `json:"autocompactBuffer,omitempty"` // Buffer percentage (default 22.5, set to 0 if disabled)
}

Config represents the Prism configuration

func Load

func Load(projectDir string) Config

Load reads and merges configuration from all config files

func (Config) GetAllSectionLines

func (c Config) GetAllSectionLines() [][]string

GetAllSectionLines returns sections as lines (for multi-line support)

func (Config) GetAutocompactBuffer

func (c Config) GetAutocompactBuffer() float64

GetAutocompactBuffer returns the autocompact buffer percentage (default 22.5)

func (Config) GetSections

func (c Config) GetSections() []string

GetSections returns the configured sections as a flat list

func (Config) IsMultiline

func (c Config) IsMultiline() bool

IsMultiline returns true if sections are configured as multi-line

func (Config) LoadPluginConfig

func (c Config) LoadPluginConfig(name string) map[string]any

LoadPluginConfig loads a plugin's own config.json and merges with prism.json overrides

Jump to

Keyboard shortcuts

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