Sample Header Ad - 728x90

How to replace current word under cursor in Emacs

27 votes
10 answers
12849 views
How do I replace current word under cursor in Emacs? I know that I can use query-replace or replace-string but every time I do so I have to type entire string to be replaced, this is just annoying. Vi has equivalent command cword and I can use a shortcut to pull the word under cursor for replacement: nmap z :%s#\=expand("")\># Anybody know how to do it with Emacs?
Asked by Think Pl (483 rep)
Oct 14, 2012, 09:19 PM
Last activity: Dec 30, 2024, 10:12 PM