nvim-hs-1.0.0.1: Haskell plugin backend for neovim

Copyright(c) Sebastian Witte
LicenseApache-2.0
Maintainerwoozletoff@gmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Neovim.Debug

Description

 

Synopsis

Documentation

debug :: env -> Neovim env a -> IO (Either (Doc AnsiStyle) a) Source #

Run a Neovim function.

This function connects to the socket pointed to by the environment variable $NVIM_LISTEN_ADDRESS and executes the command. It does not register itself as a real plugin provider, you can simply call neovim-functions from the module Neovim.API.String this way.

Tip: If you run a terminal inside a neovim instance, then this variable is automatically set.

debug' :: Neovim () a -> IO (Either (Doc AnsiStyle) a) Source #

Run a Neovim' function.

debug' a = fmap fst $ debug () () a

See documentation for debug.

develMain :: Maybe NeovimConfig -> IO (Either (Doc AnsiStyle) [Async ()]) Source #

This function is intended to be run _once_ in a ghci session that to give a REPL based workflow when developing a plugin.

Note that the dyre-based reload mechanisms, i.e. the Neovim.Plugin.ConfigHelper plugin, is not started this way.

To use this in ghci, you simply bind the results to some variables. After each reload of ghci, you have to rebind those variables.

Example:

λ Right (tids, cfg) <- develMain Nothing

λ runNeovim' cfg $ vim_call_function "getqflist" []
Right (Right (ObjectArray []))

λ :r

λ Right (tids, cfg) <- develMain Nothing

quitDevelMain :: Config env -> IO () Source #

Quit a previously started plugin provider.

restartDevelMain :: Config RPCConfig -> Maybe NeovimConfig -> IO (Either (Doc AnsiStyle) [Async ()]) Source #

Restart the development plugin provider.

printGlobalFunctionMap :: Config env -> IO () Source #

Print the global function map to the console.

runNeovim :: NFData a => Config env -> Neovim env a -> IO (Either (Doc AnsiStyle) a) Source #

Initialize a Neovim context by supplying an InternalEnvironment.

runNeovim' :: NFData a => Config env -> Neovim () a -> IO (Either (Doc AnsiStyle) a) Source #

Convenience function to run a stateless Neovim function.

module Neovim