input() gets user input. Its parameter is the prompt.
We can put it in a variable:
:exec makes a function by concatenating strings. A space adds two strings together with a space in-between. An
. adds it without the space.
function MyFunc() let some_input = input("City? ") normal AI've always loved exec ":normal A" some_input . ". " normal AIt is a wonderful city. endfunction
Then map it using
map cq :call MyFunc()^M. (You get
cq in normal mode can then result in :
I've always loved Mordor. It is a wonderful city.