呼叫 'operatorfunc'
g@{motion}
範例
一般模式 0 / 2等待指定範圍 1 / 2一般模式 2 / 2呼叫 'operatorfunc'。
已準備的 operatorfunc
- 函式
Demo(type): let g:last_type = a:type- operatorfunc
Demo- last_type
尚未呼叫
自訂運算子已就緒,等待移動指令指定範圍。
已準備的 operatorfunc
- 函式
Demo(type): let g:last_type = a:type- operatorfunc
Demo- last_type
尚未呼叫
對單字移動呼叫 Demo('char') 並設定操作標記。
已準備的 operatorfunc
- 函式
Demo(type): let g:last_type = a:type- operatorfunc
Demo- last_type
char- 標記 '[ 和 ']
第 1 行,第 1/4 欄(one 及後方的空格)
操作前後
操作前
已準備的 operatorfunc
- 函式
Demo(type): let g:last_type = a:type- operatorfunc
Demo- last_type
尚未呼叫
操作後
已準備的 operatorfunc
- 函式
Demo(type): let g:last_type = a:type- operatorfunc
Demo- last_type
char- 標記 '[ 和 ']
第 1 行,第 1/4 欄(one 及後方的空格)
操作示意。假設已啟用 +eval。operatorfunc 指定了預先準備的無害 Demo(type) 函式,該函式會將其引數記錄在 g:last_type 中。以 w 完成該運算子。緩衝區文字保持不變。
one two
three four游標位於第 1 行,第 1 欄