Home Explore Blog CI



neovim

71th chunk of `runtime/doc/vimfn.txt`
82ac92872c68f47ace994a0c6edf40f47d731f162e43298b0000000100000fb8
 the DLL
		without the ".DLL" suffix.  A full path is only required if
		the DLL is not in the usual places.
		For Unix: When compiling your own plugins, remember that the
		object code must be compiled as position-independent ('PIC').
		Examples: >vim
			echo libcall("libc.so", "getenv", "HOME")

                Parameters: ~
                  • {libname} (`string`)
                  • {funcname} (`string`)
                  • {argument} (`any`)

                Return: ~
                  (`any`)

libcallnr({libname}, {funcname}, {argument})                       *libcallnr()*
		Just like |libcall()|, but used for a function that returns an
		int instead of a string.
		Examples: >vim
			echo libcallnr("/usr/lib/libc.so", "getpid", "")
			call libcallnr("libc.so", "printf", "Hello World!\n")
			call libcallnr("libc.so", "sleep", 10)
<

                Parameters: ~
                  • {libname} (`string`)
                  • {funcname} (`string`)
                  • {argument} (`any`)

                Return: ~
                  (`any`)

line({expr} [, {winid}])                                                *line()*
		See |getpos()| for accepted positions.

		To get the column number use |col()|.  To get both use
		|getpos()|.

		With the optional {winid} argument the values are obtained for
		that window instead of the current window.

		Returns 0 for invalid values of {expr} and {winid}.

		Examples: >vim
			echo line(".")			" line number of the cursor
			echo line(".", winid)		" idem, in window "winid"
			echo line("'t")			" line number of mark t
			echo line("'" .. marker)	" line number of mark marker
<
		To jump to the last known position when opening a file see
		|last-position-jump|.

                Parameters: ~
                  • {expr} (`string|integer[]`)
                  • {winid} (`integer?`)

                Return: ~
                  (`integer`)

line2byte({lnum})                                                  *line2byte()*
		Return the byte count from the start of the buffer for line
		{lnum}.  This includes the end-of-line character, depending on
		the 'fileformat' option for the current buffer.  The first
		line returns 1. UTF-8 encoding is used, 'fileencoding' is
		ignored.  This can also be used to get the byte count for the
		line just below the last line: >vim
			echo line2byte(line("$") + 1)
<		This is the buffer size plus one.  If 'fileencoding' is empty
		it is the file size plus one.  {lnum} is used like with
		|getline()|.  When {lnum} is invalid -1 is returned.
		Also see |byte2line()|, |go| and |:goto|.

                Parameters: ~
                  • {lnum} (`integer|string`)

                Return: ~
                  (`integer`)

lispindent({lnum})                                                *lispindent()*
		Get the amount of indent for line {lnum} according the lisp
		indenting rules, as with 'lisp'.
		The indent is counted in spaces, the value of 'tabstop' is
		relevant.  {lnum} is used just like in |getline()|.
		When {lnum} is invalid, -1 is returned.

                Parameters: ~
                  • {lnum} (`integer|string`)

                Return: ~
                  (`integer`)

list2blob({list})                                                  *list2blob()*
		Return a Blob concatenating all the number values in {list}.
		Examples: >vim
			echo list2blob([1, 2, 3, 4])	" returns 0z01020304
			echo list2blob([])		" returns 0z
<		Returns an empty Blob on error.  If one of the numbers is
		negative or more than 255 error *E1239* is given.

		|blob2list()| does the opposite.

                Parameters: ~
                  • {list} (`any[]`)

                Return: ~
                  (`string`)

list2str({list} [, {utf8}])                                         *list2str()*
		Convert each number in {list} to a character string can
		concatenate them all.  Examples: >vim
			echo list2str([32])		" returns " "
			echo list2str([65, 66, 67])	" returns "ABC"
<		The same can be done

Title: Vim Function Documentation: libcallnr(), line(), line2byte(), lispindent(), list2blob(), and list2str()
Summary
This documentation describes more Vim functions. `libcallnr()` is similar to `libcall()` but expects the function to return an integer. `line()` returns the line number of a position. `line2byte()` returns the byte count from the start of the buffer for a given line. `lispindent()` returns the indent for a line according to Lisp indenting rules. `list2blob()` returns a Blob concatenating the number values in a list. `list2str()` converts each number in a list to a character string and concatenates them.