Module: Neovim
- Defined in:
- lib/neovim.rb,
lib/neovim/api.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/message.rb,
lib/neovim/session.rb,
lib/neovim/tabpage.rb,
lib/neovim/version.rb,
lib/neovim/host/cli.rb,
lib/neovim/connection.rb,
lib/neovim/event_loop.rb,
lib/neovim/executable.rb,
lib/neovim/line_range.rb,
lib/neovim/plugin/dsl.rb,
lib/neovim/client_info.rb,
lib/neovim/host/loader.rb,
lib/neovim/remote_module.rb,
lib/neovim/remote_object.rb,
lib/neovim/ruby_provider.rb,
lib/neovim/plugin/handler.rb,
lib/neovim/remote_module/dsl.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
process using 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 using Neovim.attach_child
.
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: API, Buffer, Client, ClientInfo, Connection, Current, EventLoop, Executable, Host, LineRange, Message, Plugin, RemoteModule, RemoteObject, Session, Tabpage, Window
Constant Summary collapse
- VERSION =
Gem::Version.new("0.10.0")
Class Method Summary collapse
-
.attach_child(argv = [executable.path]) ⇒ 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. -
.executable ⇒ Executable
Return a
Neovim::Executable
representing the activenvim
executable. -
.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_remote(&block) ⇒ Object
Start a remote module process with handlers defined in the config block.
Instance Method Summary collapse
-
#del_var(name) ⇒ void
See :h nvim_tabpage_del_var().
-
#get_number ⇒ Integer
See :h nvim_tabpage_get_number().
-
#get_var(name) ⇒ Object
See :h nvim_tabpage_get_var().
-
#get_win ⇒ Window
See :h nvim_tabpage_get_win().
-
#is_valid ⇒ Boolean
See :h nvim_tabpage_is_valid().
-
#list_wins ⇒ Array<Window>
See :h nvim_tabpage_list_wins().
-
#set_var(name, value) ⇒ void
See :h nvim_tabpage_set_var().
-
#set_win(win) ⇒ void
See :h nvim_tabpage_set_win().
Class Method Details
.attach_child(argv = [executable.path]) ⇒ Client
Spawn and connect to a child nvim
process.
83 84 85 |
# File 'lib/neovim.rb', line 83 def self.attach_child(argv=[executable.path]) attach(EventLoop.child(argv)) end |
.attach_tcp(host, port) ⇒ Client
Connect to a running nvim
instance over TCP.
65 66 67 |
# File 'lib/neovim.rb', line 65 def self.attach_tcp(host, port) attach(EventLoop.tcp(host, port)) end |
.attach_unix(socket_path) ⇒ Client
Connect to a running nvim
instance over a UNIX domain socket.
74 75 76 |
# File 'lib/neovim.rb', line 74 def self.attach_unix(socket_path) attach(EventLoop.unix(socket_path)) end |
.executable ⇒ Executable
Return a Neovim::Executable
representing the active nvim
executable.
108 109 110 |
# File 'lib/neovim.rb', line 108 def self.executable @executable ||= Executable.from_env end |
.logger ⇒ Logger
The Neovim global logger.
125 126 127 |
# File 'lib/neovim.rb', line 125 def self.logger Logging.logger end |
.logger=(logger) ⇒ Logger
Set the Neovim global logger.
117 118 119 |
# File 'lib/neovim.rb', line 117 def self.logger=(logger) Logging.logger = logger end |
.plugin ⇒ Object
Placeholder method for exposing the remote plugin DSL. This gets temporarily overwritten in Host::Loader#load.
100 101 102 |
# File 'lib/neovim.rb', line 100 def self.plugin raise "Can't call Neovim.plugin outside of a plugin host." end |
.start_remote(&block) ⇒ Object
Start a remote module process with handlers defined in the config block. Blocks indefinitely to handle messages.
91 92 93 |
# File 'lib/neovim.rb', line 91 def self.start_remote(&block) RemoteModule.from_config_block(&block).start end |
Instance Method Details
#del_var(name) ⇒ void
This method returns an undefined value.
See :h nvim_tabpage_del_var()
|
# File 'lib/neovim/tabpage.rb', line 10
|
#get_number ⇒ Integer
See :h nvim_tabpage_get_number()
|
# File 'lib/neovim/tabpage.rb', line 10
|
#is_valid ⇒ Boolean
See :h nvim_tabpage_is_valid()
|
# File 'lib/neovim/tabpage.rb', line 10
|
#set_var(name, value) ⇒ void
This method returns an undefined value.
See :h nvim_tabpage_set_var()
|
# File 'lib/neovim/tabpage.rb', line 10
|
#set_win(win) ⇒ void
This method returns an undefined value.
See :h nvim_tabpage_set_win()
|
# File 'lib/neovim/tabpage.rb', line 10
|