Copyright | (c) Sebastian Witte |
---|---|
License | Apache-2.0 |
Maintainer | woozletoff@gmail.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
- data FunctionalityDescription
- newtype FunctionName = F ByteString
- data Synchronous
- data CommandOption
- data CommandOptions
- data RangeSpecification
- data CommandArguments = CommandArguments {}
- getCommandOptions :: CommandOptions -> [CommandOption]
- mkCommandOptions :: [CommandOption] -> CommandOptions
- data AutocmdOptions = AutocmdOptions {
- acmdPattern :: String
- acmdNested :: Bool
- acmdGroup :: Maybe String
- class HasFunctionName a where
Documentation
data FunctionalityDescription Source #
Functionality specific functional description entries.
All fields which are directly specified in these constructors are not
optional, but can partialy be generated via the Template Haskell functions.
The last field is a data type that contains all relevant options with
sensible defaults, hence def
can be used as an argument.
Function FunctionName Synchronous | Exported function. Callable via
|
Command FunctionName CommandOptions | Exported Command. Callable via
|
Autocmd ByteString FunctionName AutocmdOptions | Exported autocommand. Will call the given function if the type and filter match. NB: Since we are registering this on the Haskell side of things, the number of accepted arguments should be 0.
|
newtype FunctionName Source #
Essentially just a string.
data Synchronous Source #
This option detemines how neovim should behave when calling some functionality on a remote host.
Async | Call the functionality entirely for its side effects and do not wait for it to finish. Calling a functionality with this flag set is completely asynchronous and nothing is really expected to happen. This is why a call like this is called notification on the neovim side of things. |
Sync | Call the function and wait for its result. This is only synchronous on the neovim side. This means that the GUI will (probably) not allow any user input until a reult is received. |
data CommandOption Source #
Options for commands.
Some command can also be described by using the OverloadedString extensions.
This means that you can write a literal String
inside your source file in
place for a CommandOption
value. See the documentation for each value on
how these strings should look like (Both versions are compile time checked.)
CmdSync Synchronous | Stringliteral "sync" or "async" |
CmdRegister | Register passed to the command. Stringliteral: |
CmdNargs String | Command takes a specific amount of arguments Automatically set via template haskell functions. You really shouldn't use this option yourself unless you have to. |
CmdRange RangeSpecification | Determines how neovim passes the range. Stringliterals: "%" for |
CmdCount Word | Command handles a count. The argument defines the default count. Stringliteral: string of numbers (e.g. "132") |
CmdBang | Command handles a bang Stringliteral: "!" |
data CommandOptions Source #
Newtype wrapper for a list of CommandOption
. Any properly constructed
object of this type is sorted and only contains zero or one object for each
possible option.
data RangeSpecification Source #
Specification of a range that acommand can operate on.
CurrentLine | The line the cursor is at when the command is invoked. |
WholeFile | Let the command operate on every line of the file. |
RangeCount Int | Let the command operate on each line in the given range. |
data CommandArguments Source #
You can use this type as the first argument for a function which is intended to be exported as a command. It holds information about the special attributes a command can take.
CommandArguments | |
|
mkCommandOptions :: [CommandOption] -> CommandOptions Source #
Smart constructor for CommandOptions
. This sorts the command options and
removes duplicate entries for semantically the same thing. Note that the
smallest option stays for whatever ordering is defined. It is best to simply
not define the same thing multiple times.
data AutocmdOptions Source #
Options that can be used to register an autocmd. See :h :autocmd
or any
referenced neovim help-page from the fields of this data type.
AutocmdOptions | |
|
class HasFunctionName a where Source #
Conveniennce class to extract a name from some value.
name :: a -> FunctionName Source #