yi-core-0.19.4: Yi editor core library

License | GPL-2
Maintainer | yi-devel@googlegroups.com
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell2010

Yi.Config

Description

Module exposing common user settings. Users most likely want to be starting with Yi.Config.Default.

Synopsis

- data Config = Config {
  - startFrontEnd :: UIBoot
  - configUI :: !UIConfig
  - startActions :: ![Action]
  - initialActions :: ![Action]
  - defaultKm :: !KeymapSet
  - configInputPreprocess :: !(P Event Event)
  - modeTable :: ![AnyMode]
  - debugMode :: !Bool
  - configRegionStyle :: !RegionStyle
  - configKillringAccumulate :: !Bool
  - configCheckExternalChangesObsessively :: !Bool
  - bufferUpdateHandler :: !(Seq (Seq Update -> BufferM ()))
  - layoutManagers :: ![AnyLayoutManager]
  - configVars :: !DynamicState
  }
- data UIConfig = UIConfig {
  - configFontName :: Maybe String
  - configFontSize :: Maybe Int
  - configScrollStyle :: Maybe ScrollStyle
  - configScrollWheelAmount :: Int
  - configLeftSideScrollBar :: Bool
  - configAutoHideScrollBar :: Bool
  - configAutoHideTabBar :: Bool
  - configLineWrap :: Bool
  - configCursorStyle :: CursorStyle
  - configWindowFill :: Char
  - configTheme :: Theme
  - configLineNumbers :: Bool
  }
- type UIBoot = Config -> ([Event] -> IO ()) -> ([Action] -> IO ()) -> Editor -> IO (UI Editor)
- data CursorStyle
  - = AlwaysFat
  - | NeverFat
  - | FatWhenFocused
  - | FatWhenFocusedAndInserting
- module Yi.Config.Lens
- configStyle :: UIConfig -> UIStyle
- configFundamentalMode :: Config -> AnyMode
- configTopLevelKeymap :: Config -> Keymap

# Documentation

data Config Source #

Configuration record. All Yi hooks can be set here.

Constructors

Config |

Fields

- startFrontEnd :: UIBoot

  UI to use.

- configUI :: !UIConfig

  UI-specific configuration.

- startActions :: ![Action]

  Actions to run when the editor is started.

- initialActions :: ![Action]

  Actions to run after startup (after startActions) or reload.

- defaultKm :: !KeymapSet

  Default keymap to use.

- configInputPreprocess :: !(P Event Event)
- modeTable :: ![AnyMode]

  List modes by order of preference.

- debugMode :: !Bool

  Produce a .yi.dbg file with a lot of debug information.

- configRegionStyle :: !RegionStyle

  Set to `Exclusive` for an emacs-like behaviour.

- configKillringAccumulate :: !Bool

  Set to `True` for an emacs-like behaviour, where all deleted text is accumulated in a killring.

- configCheckExternalChangesObsessively :: !Bool
- bufferUpdateHandler :: !(Seq (Seq Update -> BufferM ()))
- layoutManagers :: ![AnyLayoutManager]

  List of layout managers for `cycleLayoutManagersNext`

- configVars :: !DynamicState

  Custom configuration, containing the `YiConfigVariable`s. Configure with `configVariableA`.

#### Instances

Instances details

MonadReader Config EditorM Source # |
Instance details Defined in Yi.Types Methods ask :: EditorM Config Source # local :: (Config -> Config) -> EditorM a -> EditorM a Source # reader :: (Config -> a) -> EditorM a Source #
MonadState Config ConfigM Source # |
Instance details Defined in Yi.Config.Simple.Types Methods get :: ConfigM Config Source # put :: Config -> ConfigM () Source # state :: (Config -> (a, Config)) -> ConfigM a Source #

data UIConfig Source #

Constructors

UIConfig |

Fields

- configFontName :: Maybe String

  Font name, for the UI that support it.

- configFontSize :: Maybe Int

  Font size, for the UI that support it.

- configScrollStyle :: Maybe ScrollStyle

  Style of scroll

- configScrollWheelAmount :: Int

  Amount to move the buffer when using the scroll wheel

- configLeftSideScrollBar :: Bool

  Should the scrollbar be shown on the left side?

- configAutoHideScrollBar :: Bool

  Hide scrollbar automatically if text fits on one page.

- configAutoHideTabBar :: Bool

  Hide the tabbar automatically if only one tab is present

- configLineWrap :: Bool

  Wrap lines at the edge of the window if too long to display.

- configCursorStyle :: CursorStyle
- configWindowFill :: Char

  The char with which to fill empty window space. Usually `~` for vi-like editors, ' ' for everything else.

- configTheme :: Theme

  UI colours

- configLineNumbers :: Bool

  Should we show line numbers by default?

type UIBoot = Config -> ([Event] -> IO ()) -> ([Action] -> IO ()) -> Editor -> IO (UI Editor) Source #

data CursorStyle Source #

When should we use a "fat" cursor (i.e. 2 pixels wide, rather than 1)? Fat cursors have only been implemented for the Pango frontend.

Constructors

AlwaysFat |
NeverFat |
FatWhenFocused |
FatWhenFocusedAndInserting |

module Yi.Config.Lens

configStyle :: UIConfig -> UIStyle Source #

configFundamentalMode :: Config -> AnyMode Source #

configTopLevelKeymap :: Config -> Keymap Source #