Say I want to copy what f
does. f takes an "argument" keystroke and moves the cursor there. How do I create such a mapping?
I want to have a functionality that would require me to have a character as an argument. I'm not looking for the exact, or even close, functionality of f
y/
+ the desired keystroke? :) (so create a map fory/
) - it has the advantage that it works on multiple lines, can search for more than one char, but you have to hit Enter.:h getchar()
in a function.yf
+<a char>
"to copy what f does" (so - mapyf
)f
doesn't take arguments, it's a motion (see:h left-right-motions
) that can be used with operators (see:h operator
; in fact read the entire:h motion.txt
, about everything there is very useful). So, what are you trying to do?