VimClient is a Ruby C extension providing a client for Vim's clientserver feature. It allows communication with a Vim server through a persistent connection to the X11 server, much like using another instance of Vim.

Prerequisites

  • Ruby 1.9.2 or better
  • X11 development headers
  • For the Vim server, Vim must be compiled with the '+X11' and '+clientserver' features.

Installation

Install the gem using:

gem install vim_client-ruby

Or, add it to your project's Gemfile:

gem 'vim_client-ruby'

Usage

Require the library:

require 'vim_client'

Before calling any methods, be sure to set the name of your Vim server:

VimClient.server_name = 'vim_server1'
VimClient.timeout_sec = 30 # and optionally update the timeout

For more usage information, see the documentation in lib/vim_client.rb.
Best viewed with Yard

Also, see the wiki for examples, tips and sample projects.