logoalt Hacker News

cassepipeyesterday at 8:37 PM5 repliesview on HN

Forget macros and multi-cursor. (Regex) substitutions from vim's command line replaced 98% of my editing needs and rendered a lot of my vim-fu useless.

(Just like searching with / replaced 98% of my navigation)

Editing something without having to actually place the cursor anywhere is a killer feature

Also neovim can show you your substitutions live, no need for a plugin anymore. It's the default.


Replies

Agentlientoday at 4:33 AM

Regex search and replace is definitely among my most used features and the preview in NeoVim is amazing

That said, I do find myself using recursive macros quite often. They're an easy way to make a set of random little changes which would be hard to put into a solid regex. Especially when filtering and formatting logs to produce a list of error messages on a condensed format for review. It doesn't happen as often, but I also find them incredible when doing more complex substitution across a project.

bee_rideryesterday at 11:58 PM

1) is there a reason both of the other responses to your comment are all full of Bro’s? It this an in-joke?

2) Regex is great, and vim is a good place to exercise the “try a regex” reflex. And on the regular old bash command line, it is great for making stuff like locate more precise.

mayliyesterday at 10:29 PM

Bro, not every guy/girl is a regex master, multi-cursor is a much better UI/UX wysiwyg editor for everyday users.

show 1 reply
cpillyesterday at 10:28 PM

Word Bro! Regex is so simple to read and easy to get right... and its like if Immanuel Kant wrote find and replace, yeah, learn a new language to do a single function... yEAH! 98% Bro! I'd marry Regex if I could (but if we got divorced it would be my exregex [which is almost a palindrome!] Bro!)