News for hackers. Stuff that matters.
Re:Why not just embed Neovim? by seanhunter on Thursday June 13, 2024 @03:36PM (#40673668)
This is such a weird article.

" I mean, I knew about R but I thought that, surely, no one really ever uses it."

How could someone use vim without using R? I literally use that every single time I use vim (multiple times per day) and have done for 20+ years at this point. Do people only use "change inside" and cw and things like that? I mean sure I use them but not to ever use replace is really weird to me.

Re:Why not just embed Neovim? by mrgoldenbrown on Thursday June 13, 2024 @04:06PM (#40674061)
What is a typical R use case for you? R doesn't feel worth it to me. If I'm changing a word, cw is almost always better, unless maybe the new word has the exact same number of chars as the old word.
Re:Why not just embed Neovim? by o11c on Thursday June 13, 2024 @06:38PM (#40675650)
It's practically mandatory when editing cells of hand-written table-likes.

It's faster than `ct<somechar>` for replacing part of a word.

Using `<Insert>` to toggle the mode is also something I do fairly regularly ...

I'm past the point of consciously doing these things so I probably use it more than this.

Re:Why not just embed Neovim? by cwbriscoe on Thursday June 13, 2024 @10:14PM (#40676926)
I just use 'a' or 'i'. I don't think I have ever used 'Insert'.
Re:Why not just embed Neovim? by o11c on Thursday June 13, 2024 @10:56PM (#40677136)
That requires pressing <Esc> or whatever to leave insert mode first. I'll do it if I need to do some nontrivial motions first (because i_^O is just awkward outside of mappings), but otherwise no.
Re:Why not just embed Neovim? by ddfs123 on Friday June 14, 2024 @01:18AM (#40677715)
I would just cw and space it back to correct alignment. I too edit ascii table by hand, and quite often and just find R not very useful in even this case.
Re:Why not just embed Neovim? by setopt on Friday June 14, 2024 @03:48AM (#40678563)
Or use cw, and then use a plugin like e.g. junegunn/vim-easy-align.
Re:Why not just embed Neovim? by wruza on Friday June 14, 2024 @05:27AM (#40679113)
Also table_format.vim.
Re:Why not just embed Neovim? by gpvos on Friday June 14, 2024 @06:28AM (#40679429)
In the original vi, if you use cw to change it into a longer word, you can't just use <DEL> to remove spaces after the word, but have to use <ESC> and x. So R is often more practical, and it got into my muscle memory before vim existed.
Re:Why not just embed Neovim? by seanhunter on Friday June 14, 2024 @09:31AM (#40680756)
Yeah exactly. So if I'm editing text that is somehow quasi fixed width like a table cell but doesn't fit the classic vim definition of a word or a neatly delimited thing that I can use ci/ca with.

So for example this morning I was editing cells in a latex array. They are delimited by "&" and each one is some sort of equation that doesn't fit a normal vim word definition. R to the rescue. If I need more characters than are there in the cell then I go <esc>I to carry on but this morning, R was perfect.

I never toggle insert mode with an ins key because I got in the habit of using minimalist keyboards with weird custom mappings that didn't have that key (or not that readily available) often.

Re:Why not just embed Neovim? by matejn on Thursday June 13, 2024 @03:43PM (#40673754)
Hmm I used Vim for about 10 years and I never used R. I preferred one of the c- variants, usually ct and cas. I guess it depends on acquired muscle memory?
Re:Why not just embed Neovim? by zem on Thursday June 13, 2024 @10:08PM (#40676891)
likewise, I use `r` all the time but I never even knew about `R`
Re:Why not just embed Neovim? by zogrodea on Thursday June 13, 2024 @04:40PM (#40674470)
I'm usually faster at retyping a word that has a typo, than moving to the exact locations that need edits within a word. So the c-varianta are better for me.
Re:Why not just embed Neovim? by arp242 on Thursday June 13, 2024 @07:04PM (#40675863)
Also, I find it's usually just easier for my brain to just retype a word from the start, rather than edit and fix the typo. And R is annoying if the length doesn't match.

A lot of my Vim usage is optimized to reduce the amount of time I need to spend thinking about what to do, rather than minimizing the number of keystrokes or whatnot.

Re:Why not just embed Neovim? by floxy on Thursday June 13, 2024 @06:26PM (#40675540)
Now I must really be in the minority. I use 'r' all the time, but never 'R'.
Re:Why not just embed Neovim? by ddfs123 on Friday June 14, 2024 @01:16AM (#40677696)
Isn't `R` only useful if your new string is exactly as long as the old string ? I always reach for cw.
Re:Why not just embed Neovim? by setopt on Friday June 14, 2024 @03:42AM (#40678536)
I’ve used Vim for ~2 decades, and never use R. I use r daily though.
Re:Why not just embed Neovim? by cassepipe on Friday June 14, 2024 @06:10AM (#40679333)
Same, there are so many ways to do the same thing. I'd have used R had I learned about it sooner but sed-like command for search and replace really makes it obsolete for me.

I personnally find it weird that parent can't fathom that some people are doing otherwise.

Re:Why not just embed Neovim? by mejutoco on Friday June 14, 2024 @04:10AM (#40678723)
C (until end of line) or cw, ce or similar can be quicker sometimes than thinking exactly where the char is, or an alternative that fits your brain better.
Re:Why not just embed Neovim? by q7xvh97o2pDhNrh on Friday June 14, 2024 @04:12AM (#40678735)
One time, I paired with a guy that used `R` all the time.

It was an eye-opener for me, too. I use `R` a little more often ever since then, but -- like a lot of others here -- my mental model defaulted to more of a `cw` approach.

Maybe there's just two types of vim users. This could be the latest new Silicon Valley personality test.

Re:Why not just embed Neovim? by NikkiA on Saturday June 15, 2024 @06:58PM (#40693322)
I'm mostly an emacs user, but when I vi(m) I use 'R' all the time, pressing escape when I've finished changing stuff.
Re:Why not just embed Neovim? by EdwardDiego on Friday June 14, 2024 @04:38AM (#40678867)
> How could someone use vim without using R?

I press I, I add my commit message, then I press :wq and I'm done.

Re:Why not just embed Neovim? by chongli on Friday June 14, 2024 @06:39AM (#40679484)
Just use ZZ. It performs :wq<enter> for you, saving 2 keystrokes, and it’s fast because shift and z are adjacent.
Re:Why not just embed Neovim? by sva_ on Friday June 14, 2024 @06:14AM (#40679351)
And then realize you wrote :wq into the commit msg
Re:Why not just embed Neovim? by eska on Friday June 14, 2024 @06:23AM (#40679404)
I wrote :wq in the final version of my bachelor thesis. It was marked with a squiggly line ending with a ?
Re:Why not just embed Neovim? by verticalscaler on Friday June 14, 2024 @04:42AM (#40678884)
I'd just like to point out to the vim curios Emacs users lurking in here (hi guys, you will succumb eventually) that he doesn't mean the R programming language.

Definitely nobody uses that, true. And we aren't going to make you when you decide to switch over, it isn't like a prerequisite to use the editor.

Nor is some weird shitty lisp from the 80s. There was an abomination called Vimscript until Neovim decided to murder it. Praise be.

It is now scriptable with Lua, Python, Ruby, JS if you're a satanist (who am I kidding, you probably are), whatever you want.

So honestly you're running out of excuses at this point. ;)

P.S. - Since a vim-mode will always only support the subset of Vim the authors care about it is rather pointless. Also, Neovim has a robust ecosystem of plugins this Zed thing is leaving behind. There is no escape no matter how hard novelty editors will try to fix what isn't broken.

There can be only one! /Sean Connery accent

Re:Why not just embed Neovim? by wruza on Friday June 14, 2024 @05:18AM (#40679079)
I have a repeating memory of using R in C-v context, but can’t think of an example. Vim is really reflective. I suspect r doesn’t work in block visuals, which I use often. Need to test.

Nonetheless, normal R is a useful function for editing tables and other ascii art-y texts. How can you not need it?

For non-vimers who haven’t read tfa: R turns on overwrite mode akin to pressing Ins in command line. r uses temporary replace mode for a single character. Rtext<Esc> replaces four chars, rt replaces current char to t. In both cases we start and end in normal mode.

Re:Why not just embed Neovim? by from-nibly on Friday June 14, 2024 @10:29AM (#40681258)
My brain is slower than my fingers so my edits are never that surgical. If I goofed a few letters in a word I just ciw and retype the whole thing. I never use insert mode when bot using vim either. My fingers just aren't capable of typing individual letters at any useful speed. They always want to type whole words.
Re:Why not just embed Neovim? by aodonnell2536 on Sunday June 16, 2024 @04:14PM (#40699764)
Been awhile since I’ve accidentally pressed r during visual-block editing but vim will gladly replace every cell under your selection with whatever character you choose after hitting r
Re:Why not just embed Neovim? by BaculumMeumEst on Friday June 14, 2024 @06:22AM (#40679401)
Whoops, I've used vim on and off for a long time and did not know about R. I usually either did cw, or ci, or switched to visual mode, jumped to wherever, c, then enter new stuff.
Re:Why not just embed Neovim? by addicted on Friday June 14, 2024 @11:18AM (#40681690)
I have used VIM for a very long time and I didn’t even know R was a thing.

Now that I do know what it is I’m still not sure why I’d use it.

The reality is that VIM allows you to do the same thing in many different ways and people tend to pick a style and rarely use anything outside that style.

So, for me, ciw, cw, ct<char>, cf<char>, ci<text object>, c$ are pretty much all the editing commands I use. I’m partial to ‘c’ for my editing needs.