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 內部運算式評估器評估 {expr}
(請參閱 expression)。將運算式結果以字串形式傳回。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}
。