yi-dynamic-configuration-0.19.1: Dynamic configuration support for Yi
Safe HaskellNone
  • TemplateHaskell
  • TemplateHaskellQuotes
  • GeneralizedNewtypeDeriving
  • RankNTypes
  • ExplicitForAll



Command-line options



type YiOption = Config -> Either OptionError Config Source #

An option is a function that attempts to change the configuration of the editor at runtime.

data YiOptions Source #

Custom options that should be accepted. Provided in user configuration.

The general flow is that the user adds options to his configuration. Options are essentially functions describing how to modify the configuration at runtime. When an option is called, it gets the current config and may modify it (to encode its value)


Instances details
Default YiOptions Source # 
Instance details

Defined in Yi.Option


def :: YiOptions #

YiConfigVariable YiOptions Source # 
Instance details

Defined in Yi.Option


yiCustomOptions :: Lens' Config [YiOptionDescr] Source #

Lens for accessing the list of custom options.

You can pretty much create whatever types of options you want with this. But most cases are taken care of by one of the helper functions in this module.

consYiOption :: YiOptionDescr -> Config -> Config Source #

Includes an extra option in the configuration. Small wrapper around yiCustomOptions

consYiOptions :: [YiOptionDescr] -> Config -> Config Source #

Like consYiOption but supports multiple options. Convenient for keymaps which might want to install lots of options.

Argument-less options

yiBoolOption :: Lens' Config Bool -> ArgDescr YiOption Source #

An argument which sets some configuration value to True.

yiFlagOption :: Lens' Config a -> (a -> a) -> ArgDescr YiOption Source #

An argument which applies a function transforming some inner value of the configuration.

yiActionFlagOption :: Action -> ArgDescr YiOption Source #

Flag that appends an action to the startup actions.

Argument-taking options

yiStringOption :: IsString a => Lens' Config a -> String -> ArgDescr YiOption Source #

Sets the value of an option which is any string type (hopefully text...)

This is not meant to be fully applied. By only passing in the lens you will obtain a value suitable for use in OptDescr.

yiStringOption' :: IsString a => Lens' Config (Maybe a) -> String -> ArgDescr YiOption Source #

Just like yiStringOption, except it applies a Just. Useful for setting string-like values whose default is None.

yiActionOption :: IsString a => (a -> Action) -> String -> ArgDescr YiOption Source #

Option that appends a parameterized action to the startup actions.