Re:Show HN: Subvim – Vim customized to be like SublimeText
by ineedtosleep on Saturday April 06, 2013 @02:03PM
(#5504388)
Just tried C-D on my rarely used Sublime Text, but I'm not sure if I'd personally prefer that over something like `:%s/one/two/gc`.
[ Parent
| on HN ]
Re:Show HN: Subvim – Vim customized to be like SublimeText
by njoh on Saturday April 06, 2013 @02:12PM
(#5504433)
I rarely use global find and replace nowadays (just for complex regex replaces). I hold Ctrl-D until all occurrences are selected and type the replacement string (assuming occurrences are low in quantity, which they usually are in most cases).
Re:Show HN: Subvim – Vim customized to be like SublimeText
by Already__Taken on Saturday April 06, 2013 @02:37PM
(#5504522)
You know crt + H (global find and replace) takes what's highlighted and uses the last thing you looked for it nothing is highlighted.
Re:Show HN: Subvim – Vim customized to be like SublimeText
by robin_reala on Saturday April 06, 2013 @04:09PM
(#5504839)
Ctrl+cmd+g is cmd+d for all occurrences on the page.
Re:Show HN: Subvim – Vim customized to be like SublimeText
by weaksauce on Saturday April 06, 2013 @02:35PM
(#5504517)
visual selection replacement is good too.
:'<,'>s/this/to that/g
I think vim does that automatically when you have a selection active and hit :
Re:Show HN: Subvim – Vim customized to be like SublimeText
by caioariede on Saturday April 06, 2013 @04:46PM
(#5504986)
Note that this will replace over the entirely lines even if it's a blockwise selection.
So you might consider using :'<,'>s/\%Vthis/to that/g
Re:Show HN: Subvim – Vim customized to be like SublimeText
by weaksauce on Saturday April 06, 2013 @10:41PM
(#5505895)
It might be a setting or something but it definitely doesn't do that on my machine or the linux machine I have in the cloud.
this ipsum dolor sit amet
this ipsum dolor sit amet
this ipsum dolor sit amet
this ipsum dolor sit amet
this ipsum dolor sit amet
select the middle 3 lines and do what I said will give you:
this ipsum dolor sit amet
to that ipsum dolor sit amet
to that ipsum dolor sit amet
to that ipsum dolor sit amet
this ipsum dolor sit amet
Re:Show HN: Subvim – Vim customized to be like SublimeText
by MetaCosm on Saturday April 06, 2013 @02:37PM
(#5504523)
That sounds like a lot more work...
Re:Show HN: Subvim – Vim customized to be like SublimeText
by njoh on Saturday April 06, 2013 @03:23PM
(#5504690)
No it's not! Plus, you'd get to see the replacement targets while you're holding the keys, so you'd be more confident about the final result.
Just give Ctrl-D a try for a couple of days.. It's a total different user experience compared to the traditional find/replace method.
Re:Show HN: Subvim – Vim customized to be like SublimeText
by dmatlack on Saturday April 06, 2013 @03:45PM
(#5504761)
Do you mean it's a lot of work to type in that prefix? Because vim automatically inserts it for you when you enter command mode while something is visually selected. A making a visual selection is very quick and easy.