Questions tagged [replace]

Command or mode to overwrite text. For search-and-replace operations, use the [substitute] tag.

10 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
35 views

Substitute regex group in prompt when replace with confirmation

I am using vim to replace with simple regex: %s/Foo\(.\)/Bar\1Biz/gc I wanna to confirm each occurence and Vim asks: replace with Bar\1Biz (y/n/a/q/l/^E/^Y)? Is it possible to substitute group (\1) ...
1
vote
1answer
135 views

Custom key binding for project-wide search and replace using FZF.vim Rg function?

I know that one can do a project-wide search and replace using the results of an Rg search in FZF.vim by doing the following: Run :Rg SEARCH_TERM Use Alt + a (or in my case, Esc + a, since I'm using ...
1
vote
1answer
57 views

How to add a certain word before the names of methods in Javascript?

I am working with react. First I had a component with state I created methods and all that. Now I want to convert it into stateless component. I have add the word function before each method name. ...
1
vote
0answers
33 views

Change a word with a N repating characters where N = word length

I have some code that I want to 'censor'. For example, I have secret token in a source code 1f85ez and I want to replace it with xxxxxx Now I do it with viwrx command. Is there way to make such a ...
1
vote
0answers
44 views

change ofWord to of Word, and ignore offer, office, off etc

I OCRed a document but has this problem: some spaces between "of" and the word after are gone and I need to add a space between "of" and "word". Is there any way to do it? And also to avoid adding ...
1
vote
0answers
33 views

substitute a join for a character that ends a line

when pasting from a pdf document, words in the original document are being split up, and replaced by a - and a line break. For example: alternative specifications. In con- clusion, these findings ...
1
vote
0answers
830 views

Enter insert to insert mode from function

I want to create function that search for selection and then automatically replace selection with given text. Something like *Ncgn but with custom movement (not exactly word only). My current ...
0
votes
0answers
23 views

:noesckeys in vim.basic giving anomalous behavior in ubuntu 20.04

As reported in this post, I've upgraded to ubuntu 20.04, and am seeing anomalous behavior in vim.basic In addition to the one reported there, I'm now having problems with the noesckeys setting. My ...
-1
votes
2answers
93 views

How to replace spaces inside a selection

I have this text : He's a self made man who gets what he wants. The small blue forget me not flower was first used by the Grand Lodge. And this function: function MyFunction() let myList1 ...
-2
votes
1answer
102 views

Replace in a loop

I have a buffer that contains this sentence : I go to a rendez-vous this evening. and I have this function : function MyFunction() let myList = ["rendez-vous"] let myFile = readfile(bufname(1)) ...