Home Explore Blog CI



neovim

2nd chunk of `runtime/doc/if_ruby.txt`
103e05ca1a8469ac272835f6aff02161ed77258714d4d49300000001000007f4
 a message
	VIM.command(cmd)		      # execute an Ex command
	num = VIM::Window.count		      # gets the number of windows
	w = VIM::Window[n]		      # gets window "n"
	cw = VIM::Window.current	      # gets the current window
	num = VIM::Buffer.count		      # gets the number of buffers
	b = VIM::Buffer[n]		      # gets buffer "n"
	cb = VIM::Buffer.current	      # gets the current buffer
	w.height = lines		      # sets the window height
	w.cursor = [row, col]		      # sets the window cursor position
	pos = w.cursor			      # gets an array [row, col]
	name = b.name			      # gets the buffer file name
	line = b[n]			      # gets a line from the buffer
	num = b.count			      # gets the number of lines
	b[n] = str			      # sets a line in the buffer
	b.delete(n)			      # deletes a line
	b.append(n, str)		      # appends a line after n
	line = VIM::Buffer.current.line       # gets the current line
	num = VIM::Buffer.current.line_number # gets the current line number
	VIM::Buffer.current.line = "test"     # sets the current line number
<

Module Functions:

							*ruby-message*
VIM::message({msg})
	Displays the message {msg}.

							*ruby-set_option*
VIM::set_option({arg})
	Sets a vim option.  {arg} can be any argument that the ":set" command
	accepts.  Note that this means that no spaces are allowed in the
	argument!  See |:set|.

							*ruby-command*
VIM::command({cmd})
	Executes Ex command {cmd}.

							*ruby-evaluate*
VIM::evaluate({expr})
	Evaluates {expr} using the vim internal expression evaluator (see
	|expression|).  Returns the expression result as a string.
	A |List| is turned into a string by joining the items and inserting
	line breaks.

==============================================================================
3. VIM::Buffer objects					*ruby-buffer*

VIM::Buffer objects represent vim buffers.

Class Methods:

current		Returns the current buffer object.
count		Returns the number of buffers.
self[{n}]	Returns the buffer object for the number {n}.  The first number
		is 0.

Methods:

name	

Title: VIM Module Continued: Functions and Buffer Objects
Summary
This section continues to detail the `VIM` module in the Ruby interface for Vim, providing examples of setting window heights and cursor positions, accessing buffer content, and manipulating lines within buffers. It describes the use of `VIM::message`, `VIM::set_option`, `VIM::command`, and `VIM::evaluate` functions. It then introduces `VIM::Buffer` objects, explaining class methods like `current`, `count`, and accessing buffers by index, as well as mentioning instance methods (to be continued).