ribosome-0.9.9.9: Neovim plugin framework for Polysemy
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ribosome.Settings

Description

The Settings API, an effect for accessing Neovim variables with defaults.

Synopsis

Documentation

data Setting a Source #

This type is used by the effect Settings, representing a Neovim variable associated with a plugin.

It has a name, can optionally prefixed by the plugin's name and may define a default value that is used when the variable is undefined.

The type parameter determines how the Neovim value is decoded.

Constructors

Setting 

Fields

data SettingError Source #

The errors emitted by the effect Settings.

Constructors

Unset Text

The variable is unset and has no associated default.

Decode Text DecodeError

The variable contains data that is incompatible with the type parameter of the Setting.

UpdateFailed Text RpcError

Something went wrong while attempting to set a variable.

Instances

Instances details
Show SettingError Source # 
Instance details

Defined in Ribosome.Data.SettingError

Eq SettingError Source # 
Instance details

Defined in Ribosome.Data.SettingError

Reportable SettingError Source # 
Instance details

Defined in Ribosome.Data.SettingError

menuMarginVertical :: Setting Float Source #

The vertical margin for floating windows used by ribosome-menu.

menuMarginHorizontal :: Setting Float Source #

The horizontal margin for floating windows used by ribosome-menu.

data Settings :: Effect Source #

This effects abstracts Neovim variables with associated defaults.

get :: forall a r. MsgpackDecode a => Member Settings r => Setting a -> Sem r a Source #

Get the value of the setting's Neovim variable or return the default if it is undefined.

update :: forall a r. MsgpackEncode a => Member Settings r => Setting a -> a -> Sem r () Source #

Set the value of the setting's Neovim variable.

or :: MsgpackDecode a => Member (Settings !! SettingError) r => a -> Setting a -> Sem r a Source #

Get the setting's value or return the supplied fallback value if the Neovim variable is undefined and the setting has no default value.

maybe :: MsgpackDecode a => Member (Settings !! SettingError) r => Setting a -> Sem r (Maybe a) Source #

Get Just the setting's value or return Nothing if the Neovim variable is undefined and the setting has no default value.