nvim-hs-0.2.5: Haskell plugin backend for neovim

Copyright(c) Sebastian Witte
Safe HaskellNone






wrapPlugin :: Applicative m => Plugin r st -> m NeovimPlugin Source #

Wrap a Plugin in some nice blankets, so that we can put them in a simple list.

data NeovimPlugin Source #

Plugin values are wraped inside this data type via wrapPlugin so that we can put plugins in an ordinary list.

data Plugin r st Source #

This data type contains meta information for the plugin manager.



data Synchronous Source #

This option detemines how neovim should behave when calling some functionality on a remote host.



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.


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.


Enum Synchronous Source # 
Eq Synchronous Source # 
Ord Synchronous Source # 
Read Synchronous Source # 
Show Synchronous Source # 
IsString Synchronous Source # 
Generic Synchronous Source # 

Associated Types

type Rep Synchronous :: * -> * #

Pretty Synchronous Source # 
NFData Synchronous Source # 


rnf :: Synchronous -> () #

NvimObject Synchronous Source # 
type Rep Synchronous Source # 
type Rep Synchronous = D1 * (MetaData "Synchronous" "Neovim.Plugin.Classes" "nvim-hs-0.2.5-Jju5PaldQ6jL5dqBGEr7IX" False) ((:+:) * (C1 * (MetaCons "Async" PrefixI False) (U1 *)) (C1 * (MetaCons "Sync" PrefixI False) (U1 *)))

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"


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 WholeFile, "," for line and ",123" for 123 lines.

CmdCount Word

Command handles a count. The argument defines the default count.

Stringliteral: string of numbers (e.g. "132")


Command handles a bang

Stringliteral: "!"


Eq CommandOption Source # 
Ord CommandOption Source # 
Read CommandOption Source # 
Show CommandOption Source # 
IsString CommandOption Source # 
Generic CommandOption Source # 

Associated Types

type Rep CommandOption :: * -> * #

Pretty CommandOption Source # 
NFData CommandOption Source # 


rnf :: CommandOption -> () #

type Rep CommandOption Source # 

addAutocmd Source #


:: ByteString

The event to register to (e.g. BufWritePost)

-> AutocmdOptions 
-> Neovim r st ()

Fully applied function to register

-> Neovim r st (Maybe (Either (Neovim anyR anySt ()) ReleaseKey))

A ReleaseKey if the registration worked

Register an autocmd in the current context. This means that, if you are currently in a stateful plugin, the function will be called in the current thread and has access to the configuration and state of this thread. If you need that information, but do not want to block the other functions in this thread, you have to manually fork a thread and make the state you need available there. If you don't care abou the state (or your function has been appield to all the necessary state (e.g. a TVar to share the rusult), then you can also call addAutocmd' which will register a stateless function that only interacts with other threads by means of concurrency abstractions.

Note that the function you pass must be fully applied.

Note beside: This function is equivalent to addAutocmd' if called from a stateless plugin thread.

addAutocmd' :: ByteString -> AutocmdOptions -> Neovim' () -> Neovim r st (Maybe ReleaseKey) Source #

Add a stateless autocmd.

See addAutocmd for more details.

registerInStatelessContext :: (FunctionMapEntry -> Neovim r st ()) -> FunctionalityDescription -> ([Object] -> Neovim' Object) -> Neovim r st (Maybe FunctionMapEntry) Source #

Register a functoinality in a stateless context.