Module: Neovim
- Defined in:
- lib/neovim.rb,
lib/neovim/host.rb,
lib/neovim/buffer.rb,
lib/neovim/client.rb,
lib/neovim/plugin.rb,
lib/neovim/window.rb,
lib/neovim/current.rb,
lib/neovim/logging.rb,
lib/neovim/session.rb,
lib/neovim/tabpage.rb,
lib/neovim/version.rb,
lib/neovim/line_range.rb,
lib/neovim/plugin/dsl.rb,
lib/neovim/host/loader.rb,
lib/neovim/session/api.rb,
lib/neovim/session/rpc.rb,
lib/neovim/remote_object.rb,
lib/neovim/ruby_provider.rb,
lib/neovim/plugin/handler.rb,
lib/neovim/session/request.rb,
lib/neovim/session/event_loop.rb,
lib/neovim/session/serializer.rb,
lib/neovim/session/notification.rb,
lib/neovim/ruby_provider/buffer_ext.rb,
lib/neovim/ruby_provider/window_ext.rb
Overview
The main entrypoint to the Neovim
gem. It allows you to connect to a running nvim
instance programmatically or define a remote plugin to be autoloaded by nvim
.
You can connect to a running nvim
instance by setting or inspecting the NVIM_LISTEN_ADDRESS
environment variable and connecting via the appropriate attach_
method. This is currently supported for both UNIX domain sockets and TCP. You can also spawn and connect to an nvim
subprocess via Neovim.attach_child(argv).
You can define a remote plugin using the Neovim.plugin
DSL, which allows you to register commands, functions, and autocmds. Plugins are autoloaded by nvim
from the rplugin/ruby
directory in your nvim
runtime path.
Defined Under Namespace
Modules: Logging, RubyProvider Classes: Buffer, Client, Current, Host, LineRange, Plugin, RemoteObject, Session, Tabpage, Window
Constant Summary collapse
- VERSION =
Gem::Version.new("0.3.0")
Class Method Summary collapse
-
.attach_child(argv = []) ⇒ Client
Spawn and connect to a child
nvim
process. -
.attach_tcp(host, port) ⇒ Client
Connect to a running
nvim
instance over TCP. -
.attach_unix(socket_path) ⇒ Client
Connect to a running
nvim
instance over a UNIX domain socket. -
.logger ⇒ Logger
The Neovim global logger.
-
.logger=(logger) ⇒ Logger
Set the Neovim global logger.
-
.plugin ⇒ Object
Placeholder method for exposing the remote plugin DSL.
-
.start_host(rplugin_paths) ⇒ void
Start a plugin host.
Instance Method Summary collapse
- #del_var(name) ⇒ Object
- #get_var(name) ⇒ Object
- #get_window ⇒ Window
- #get_windows ⇒ Array<Window>
- #is_valid ⇒ Boolean
- #set_var(name, value) ⇒ Object
Class Method Details
.attach_child(argv = []) ⇒ Client
Spawn and connect to a child nvim
process.
81 82 83 |
# File 'lib/neovim.rb', line 81 def self.attach_child(argv=[]) Client.new Session.child(argv) end |
.attach_tcp(host, port) ⇒ Client
Connect to a running nvim
instance over TCP.
63 64 65 |
# File 'lib/neovim.rb', line 63 def self.attach_tcp(host, port) Client.new Session.tcp(host, port) end |
.attach_unix(socket_path) ⇒ Client
Connect to a running nvim
instance over a UNIX domain socket.
72 73 74 |
# File 'lib/neovim.rb', line 72 def self.attach_unix(socket_path) Client.new Session.unix(socket_path) end |
.logger ⇒ Logger
The Neovim global logger.
118 119 120 |
# File 'lib/neovim.rb', line 118 def self.logger Logging.logger end |
.logger=(logger) ⇒ Logger
Set the Neovim global logger.
110 111 112 |
# File 'lib/neovim.rb', line 110 def self.logger=(logger) Logging.logger = logger end |
.plugin ⇒ Object
Placeholder method for exposing the remote plugin DSL. This gets temporarily overwritten in Host#load_files.
101 102 103 |
# File 'lib/neovim.rb', line 101 def self.plugin raise "Can't call Neovim.plugin outside of a plugin host." end |
.start_host(rplugin_paths) ⇒ void
This method returns an undefined value.
Start a plugin host. This is called by the nvim-ruby-host
executable, which is spawned by nvim
to discover and run Ruby plugins, and acts as the bridge between nvim
and the plugin.
92 93 94 |
# File 'lib/neovim.rb', line 92 def self.start_host(rplugin_paths) Host.load_from_files(rplugin_paths).run end |
Instance Method Details
#del_var(name) ⇒ Object
|
# File 'lib/neovim/tabpage.rb', line 8
|
#get_var(name) ⇒ Object
|
# File 'lib/neovim/tabpage.rb', line 8
|
#is_valid ⇒ Boolean
|
# File 'lib/neovim/tabpage.rb', line 8
|
#set_var(name, value) ⇒ Object
|
# File 'lib/neovim/tabpage.rb', line 8
|