How do I loop?

how do I grab text from the buffer?

getline(), expand("<cword>")

how do i put text in the buffer?

through registers

how do I search?