Let's make a function in
.vimrc and call it with a key mapping.
You start it with
function and end it with
endfunction. It has a capital letter. This makes it global.
function! if you want to redeclare a function)
Normal mode commands are issued with
function MyFunc() normal iHello there normal ddPPP endfunction
This inserts "Hello there". Then deletes it. Then pastes it three times.
Let's map it to
map cq :call MyFunc()^M (You get
And you will get
Hello there Hello there Hello there