I'm writing a Vim script. How can I get the word under the cursor and the text of the current line?
You can with expand and getline:
let wordUnderCursor = expand("<cword>") let currentLine = getline(".")