| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Vgrep.Environment.Config
Synopsis
- data Config = Config {
- _colors :: Colors
- _tabstop :: Int
- _editor :: String
- _keybindings :: Keybindings
- data Colors = Colors {
- _lineNumbers :: Attr
- _lineNumbersHl :: Attr
- _normal :: Attr
- _normalHl :: Attr
- _fileHeaders :: Attr
- _selected :: Attr
- data Keybindings = Keybindings {}
- tabstop :: Lens' Config Int
- keybindings :: Lens' Config Keybindings
- editor :: Lens' Config String
- colors :: Lens' Config Colors
- selected :: Lens' Colors Attr
- normalHl :: Lens' Colors Attr
- normal :: Lens' Colors Attr
- lineNumbersHl :: Lens' Colors Attr
- lineNumbers :: Lens' Colors Attr
- fileHeaders :: Lens' Colors Attr
- resultsKeybindings :: Lens' Keybindings KeybindingMap
- pagerKeybindings :: Lens' Keybindings KeybindingMap
- globalKeybindings :: Lens' Keybindings KeybindingMap
- fromConfigMonoid :: ConfigMonoid -> Config
- fromColorsMonoid :: ColorsMonoid -> Colors
- fromFirst :: a -> First a -> a
- fromKeybindingsMonoid :: KeybindingsMonoid -> Keybindings
- defaultConfig :: Config
- defaultColors :: Colors
- defaultKeybindings :: Keybindings
- loadConfig :: MonadIO io => ConfigMonoid -> io Config
Types
Constructors
| Config | |
Fields
| |
Constructors
| Colors | |
Fields
| |
data Keybindings Source #
Constructors
| Keybindings | |
Fields
| |
Instances
| Eq Keybindings Source # | |
Defined in Vgrep.Environment.Config | |
| Show Keybindings Source # | |
Defined in Vgrep.Environment.Config Methods showsPrec :: Int -> Keybindings -> ShowS # show :: Keybindings -> String # showList :: [Keybindings] -> ShowS # | |
Auto-generated Lenses
Read Config from Monoid
fromConfigMonoid :: ConfigMonoid -> Config Source #
Convert a ConfigMonoid to a Config. Missing () values in the
memptyConfigMonoid are supplied from the defaultConfig.
fromColorsMonoid :: ColorsMonoid -> Colors Source #
Convert a ColorsMonoid to a Colors config.
Default Config
Config Loader
Arguments
| :: MonadIO io | |
| => ConfigMonoid | External config from command line |
| -> io Config |
Gathers ConfigMonoids from various sources and builds a Config
based on the defaultConfig:
- Config from environment variables
- The configuration specified in the config file
- External config, e.g. from command line
where the latter ones override the earlier ones.