yi-keymap-vim-0.19.0: Vim keymap for Yi editor

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

Extensions

- ScopedTypeVariables
- OverloadedStrings
- ExplicitForAll
- LambdaCase

Yi.Keymap.Vim.Ex.Commands.Common

Description

Implements common `ExCommand`s for the Vim keymap.

Synopsis

- parse :: Parser ExCommand -> EventString -> Maybe ExCommand
- parseWithBang :: Parser a -> (a -> Bool -> Parser ExCommand) -> EventString -> Maybe ExCommand
- parseWithBangAndCount :: Parser a -> (a -> Bool -> Maybe Int -> Parser ExCommand) -> EventString -> Maybe ExCommand
- parseRange :: Parser (Maybe (BufferM Region))
- data BoolOptionAction
  - = BoolOptionSet !Bool
  - | BoolOptionInvert
  - | BoolOptionAsk
- data TextOptionAction
  - = TextOptionSet !Text
  - | TextOptionAsk
- parseBoolOption :: Text -> (BoolOptionAction -> Action) -> EventString -> Maybe ExCommand
- parseTextOption :: Text -> (TextOptionAction -> Action) -> EventString -> Maybe ExCommand
- filenameComplete :: Text -> YiM [Text]
- forAllBuffers :: MonadEditor m => (BufferRef -> m ()) -> m ()
- pureExCommand :: ExCommand
- impureExCommand :: ExCommand
- errorNoWrite :: EditorM ()
- commandArgs :: Parser [Text]
- needsSaving :: BufferRef -> YiM Bool

# Documentation

parse :: Parser ExCommand -> EventString -> Maybe ExCommand Source #

parseWithBang Source #

Arguments

:: Parser a | The command name parser.
-> (a -> Bool -> Parser ExCommand) | A parser for the remaining command arguments.
-> EventString | The string to parse.
-> Maybe ExCommand |

parseWithBangAndCount Source #

Arguments

:: Parser a | The command name parser.
-> (a -> Bool -> Maybe Int -> Parser ExCommand) | A parser for the remaining command arguments.
-> EventString | The string to parse.
-> Maybe ExCommand |

parseRange :: Parser (Maybe (BufferM Region)) Source #

data BoolOptionAction Source #

Constructors

BoolOptionSet !Bool |
BoolOptionInvert |
BoolOptionAsk |

data TextOptionAction Source #

Constructors

TextOptionSet !Text |
TextOptionAsk |

parseBoolOption :: Text -> (BoolOptionAction -> Action) -> EventString -> Maybe ExCommand Source #

parseTextOption :: Text -> (TextOptionAction -> Action) -> EventString -> Maybe ExCommand Source #

filenameComplete :: Text -> YiM [Text] Source #

forAllBuffers :: MonadEditor m => (BufferRef -> m ()) -> m () Source #

pureExCommand :: ExCommand Source #

impureExCommand :: ExCommand Source #

errorNoWrite :: EditorM () Source #

Show the common error message about an unsaved file on the status line.

commandArgs :: Parser [Text] Source #

Useful parser for any Ex command that acts kind of like a shell

needsSaving :: BufferRef -> YiM Bool Source #