I want to write a command that specifies \"the word under the cursor\" in VIM. For instance, let\'s say I have the cursor on a word and I make it appear twice. For instance, i
You need to escape the backslashes within the mapping. You can also include the substitution string within the mapping.
:nmap w :s/\\(=expand("")\\)/\\1\\1