Nvim :help 页面,生成 于 源 使用 tree-sitter-vimdoc 解析器。
{cmd} 执行 Ruby 命令 {cmd}。一个尝试它的命令:ruby print "Hello":rub[y] << [trim] [
{endmarker}] {script} {endmarker} 执行 Ruby 脚本 {script}。function! RedGem()
ruby << EOF
class Garnet
def initialize(s)
@buffer = VIM::Buffer.current
vimputs(s)
end
def vimputs(s)
@buffer.append(@buffer.count,s)
end
end
gem = Garnet.new("pretty")
EOF
endfunction:ruby print RUBY_VERSION
{cmd} 针对 [range] 中的每一行对 Ruby 命令 {cmd} 进行求值,其中 $_ 被设置为每一行的文本,后面不带 <EOL>。设置 $_ 会更改文本,但请注意,无法使用此命令添加或删除行。[range] 的默认值为整个文件:"1,$"。print "Hello" # displays 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
{arg}) 设置 vim 选项。{arg} 可以是 ":set" 命令接受的任何参数。请注意,这意味着参数中不允许使用空格!请参阅 :set。{expr}) 使用 vim 内部表达式求值器 (参见 expression) 对 {expr} 进行求值。将表达式结果作为字符串返回。List 通过连接项目并插入换行符来转换为字符串。{n}] 返回编号为 {n} 的缓冲区对象。第一个数字是 0。{n}] 返回缓冲区中的某一行。{n} 是行号。self[{n}] = {str} 设置缓冲区中的某一行。{n} 是行号。delete({n}) 从缓冲区中删除某一行。{n} 是行号。append({n}, {str}) 在行 {n} 之后追加一行。line 如果缓冲区处于活动状态,则返回缓冲区的当前行。line = {str} 如果缓冲区处于活动状态,则设置缓冲区的当前行。line_number 如果缓冲区处于活动状态,则返回当前行的编号。{n}] 返回编号为 {n} 的窗口对象。第一个数字是 0。{n} 将窗口高度设置为 {n}。width 返回窗口的宽度。width = {n} 将窗口宽度设置为 {n}。cursor 返回游标位置的 [row, col] 数组。第一行编号为 1,第一列编号为 0。cursor = [{row}, {col}] 将游标位置设置为 {row} 和 {col}。