News for hackers. Stuff that matters.
Re:How Did Vim Become So Popular? by lostmsu on Tuesday June 30, 2020 @09:34PM (#23696793)
> now find JUNK and replace 'a1' with 'A1' in the 15 lines that follow

The real scenario is usually to replace, for example, in a function block. How do you do that? Counting function lines seems like a non-starter.

Re:How Did Vim Become So Popular? by tvb12 on Tuesday June 30, 2020 @10:34PM (#23697138)
If the language uses curly braces to define blocks, it's easier: ciB. Parentheses are easy as well: cib. Otherwise, I'm not sure there's a good solution currently. You can substitute by indentation with a plugin (https://github.com/kana/vim-textobj-indent/blob/master/doc/t...). For Lua, I usually do c/end<enter>.

I believe this is an area where treesitter can help, so I'm looking forward to Neovim's integration.

Re:How Did Vim Become So Popular? by jcranmer on Tuesday June 30, 2020 @10:17PM (#23697015)
Highlighting the initial { of a function and then typing 'va}' ('v' for entering visual mode, and 'a}' moves to the matching close brace. Similar commands work the [], (), and <> pairs) selects the entire function body. From there, a regular s command will operate on the entire selected text.
Re:How Did Vim Become So Popular? by joatmon-snoo on Tuesday June 30, 2020 @10:24PM (#23697069)
Mine is v% :)
Re:How Did Vim Become So Popular? by alwillis on Wednesday July 01, 2020 @06:02AM (#23699785)
You know these aren’t new issues, right? Vim has been around since 1991 and back to 1976 from Bill Joy’s editor.

Of course Vim can replace a function block easily and has been able to do so for decades.