I'm new to Vim. Now I'm trying to write a vim script. How can I get the word under the cursor and the text of the current line? I want to use it in my script, thanks.
I'm new to Vim. Now I'm trying to write a vim script. How can I get the word under the cursor and the text of the current line? I want to use it in my script, thanks.
You can with expand and getline:
let wordUnderCursor = expand("<cword>") let currentLine = getline(".")