Reputation
Top tag
Next privilege 125 Rep.
Vote down
Badges
6
Impact
~2k people reached

  • 0 posts edited
  • 1 helpful flag
  • 9 votes cast
Jan
23
comment Edit Nth occurence interactively in a search in vim
Thank you for the answer, but in this case I don't know in advance how many (if any) ns there are.
Jan
21
comment Edit Nth occurence interactively in a search in vim
Thanks for answering, but please see the accepted answer for the correct interpretation of my question.
Jan
21
comment Edit Nth occurence interactively in a search in vim
Yes, exactly! I would like to add that you need to do enter when you would like to make the "normal" operations (cw or the like) to the found occurrence.
Jan
21
comment Edit Nth occurence interactively in a search in vim
Thanks for the update, but with your solution I get either/or. It is exactly when "so you can decide to replace or not" happens, that I would like to press e.g. ciw to replace that occurrence of the word. I don't want to first search for a word, n-ing through the file, finding an occurrence I don't like, esc-ing and then doing ::%s/foo/bar/gc to step through the file once more.
Jan
21
comment Edit Nth occurence interactively in a search in vim
I mean interactive as when just casually browsing the file via /{search-phrase}, pressing n (or p) repeatedly and then stumbling over some occurrence of 'foo' that should not be there or be something else. When browsing a file, I just /foo and n for some file without knowing in advance whether or not I am going to be replacing stuff.
Jan
21
comment Edit Nth occurence interactively in a search in vim
Thanks, but as per my comment to @Thushi, I am looking for an interactive way of doing this.
Jan
21
comment Edit Nth occurence interactively in a search in vim
Thanks, but I'm looking for a solution when just casually browsing the file via /{search-phrase}, pressing n repeatedly and then stumbling over some occurrence of 'foo' that should not be there or be something else. I have already found the answers when I up-front know that I'm going to (possibly or most likely) be replacing some text.
Jun
27
comment Splitting string by the first occurrence of a delimiter
I would like to emphasize the trailing dash in -f 2- in the string="$( cut -d ';' -f 2- <<< "$s" )"; echo "$string" command. This is what ignores the rest of the delimiters in the string for the printout. Not obvious when looking at the man page of cut