キーを1回押すだけでvim関数を待機させるにはどうすればよいですか?
例:
f
キーが押されたときに実行するようにマップされた関数 NextOccur を作成します- が押されたとき、
f
すぐには何も役に立たないはずです - 次のキー(たとえば
x
)が押された後、カーソルは次の発生に移動する必要がありますx
PS: はい、私はそれがデフォルトで行うことを正確に知って
f
います (ただし、行単位のみですが)。
次の 2 回のキー押下を待ちたい場合、それも可能ですか?
You can use the built-in getchar()
function. It waits for a single keypress and then returns it. For an ordinary 8-bit character, you have to use nr2char(getchar())
to convert it to a String.
It seems you want to extend the f
/ t
commands to cover multiple lines, too. Be aware that there are already plugins that do that, for example ft_improved.