Class: Neovim::Plugin::DSL
- Inherits:
- BasicObject
- Defined in:
- lib/neovim/plugin/dsl.rb
Overview
The DSL exposed in Neovim.plugin
blocks.
Instance Method Summary collapse
-
#autocmd(event, options = {}, &block) ⇒ Object
Register an
nvim
autocmd. -
#command(name, options = {}, &block) ⇒ Object
Register an
nvim
command. -
#function(name, options = {}, &block) ⇒ Object
Register an
nvim
function. -
#initialize(plugin) ⇒ DSL
constructor
A new instance of DSL.
-
#rpc(name, options = {}, &block) ⇒ Object
Register a top-level remote procedure call (RPC).
Constructor Details
#initialize(plugin) ⇒ DSL
Returns a new instance of DSL.
7 8 9 |
# File 'lib/neovim/plugin/dsl.rb', line 7 def initialize(plugin) @plugin = plugin end |
Instance Method Details
#autocmd(event, options = {}, &block) ⇒ Object
Register an nvim
autocmd.
51 52 53 |
# File 'lib/neovim/plugin/dsl.rb', line 51 def autocmd(event, ={}, &block) register_handler(:autocmd, event, , block) end |
#command(name, options = {}, &block) ⇒ Object
Register an nvim
command.
25 26 27 |
# File 'lib/neovim/plugin/dsl.rb', line 25 def command(name, ={}, &block) register_handler(:command, name, , block) end |
#function(name, options = {}, &block) ⇒ Object
Register an nvim
function.
38 39 40 |
# File 'lib/neovim/plugin/dsl.rb', line 38 def function(name, ={}, &block) register_handler(:function, name, , block) end |
#rpc(name, options = {}, &block) ⇒ Object
Register a top-level remote procedure call (RPC).
This can be used to directly expose an RPC call without a namespace. This is used primarily for exposing legacy ruby provider calls.
61 62 63 64 65 66 67 |
# File 'lib/neovim/plugin/dsl.rb', line 61 def rpc(name, ={}, &block) sync = .delete(:sync) @plugin.handlers.push( Handler.unqualified(name, sync, , block) ) end |