Replacing ANY word with a given string

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Replacing ANY word with a given string

Varun Gupta
Hi All


Is there any way by which i can replace ANY word
(Under cursor) to some predefined one .


Regards

Varun

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
Reply | Threaded
Open this post in threaded view
|

Re: Replacing ANY word with a given string

Mark Woodward
Hi Varun

Varun Gupta wrote:

>Hi All
>
>
>Is there any way by which i can replace ANY word
>(Under cursor) to some predefined one .
>  
>
for normal mode:
    :nnoremap <leader>cw  ciwtext to insert<esc>

--
Mark

Reply | Threaded
Open this post in threaded view
|

Re: Replacing ANY word with a given string

Bugzilla from peterp@stack.nl
In reply to this post by Varun Gupta
> Hi All
>
>
> Is there any way by which i can replace ANY word
> (Under cursor) to some predefined one .

You can do the following:
map <Leader>s :%s/<C-R><C-W>/replacewith/g<CR>


Regards,

Peter Palm