News for hackers. Stuff that matters.
Re:Vim 9.0 by threatofrain on Thursday June 30, 2022 @05:10PM (#31938659)
No line numbers? @_@
Re:Vim 9.0 by bayindirh on Thursday June 30, 2022 @05:12PM (#31938670)
It is already present on the lower right by default. Why lose a column?
Re:Vim 9.0 by bluenose69 on Thursday June 30, 2022 @05:41PM (#31938993)
I like line numbers because when I'm editing code in a remote meeting, I or someone else can refer to lines by number. The current line is not the only one that matters. I use relative line numbers because I like doing e.g. 9k or whatever. Others on a remote call often refer to other parts of the code with "9 up" or "9 down" (since "9k" and "9j" sound too alike in a noisy call).
Re:Vim 9.0 by sodapopcan on Friday July 01, 2022 @02:29AM (#31943101)
When I started pairing every day at work, I used to do:

  if $WORK_COMPUTER
    set number
  endif
But then I came to like line numbers and just have 'em on all the time now.
Re:Vim 9.0 by bayindirh on Thursday June 30, 2022 @05:42PM (#31939007)
You can selectively turn them on as a meeting aid, no?
Re:Vim 9.0 by Diederich on Thursday June 30, 2022 @05:50PM (#31939105)
Yup that's what I do as needed, which for me is pretty rare.
Re:Vim 9.0 by imron on Thursday June 30, 2022 @06:21PM (#31939436)
It makes it easy to jump to other lines on your screen, e.g. maybe you want to split out half the code from a loop to another function. You can't use di{ to delete everything in the {} because you only want half of it, but if you can see that the loop contents end on line 98 you can go d98G
Re:Vim 9.0 by cassepipe on Thursday June 30, 2022 @05:52PM (#31939136)
Then I can easily go to the line I want to go. :34 takes me to line 34
Re:Vim 9.0 by imron on Thursday June 30, 2022 @10:13PM (#31941394)
34G will save you a keystroke :-D
Re:Vim 9.0 by sodapopcan on Friday July 01, 2022 @02:30AM (#31943104)
...and 34gg will save you a chord ;)
Re:Vim 9.0 by imron on Friday July 01, 2022 @02:42AM (#31943167)
It will, but I generally prefer chords on separate hands over double keys on the same hand.
Re:Vim 9.0 by sodapopcan on Friday July 01, 2022 @11:28AM (#31947767)
I actually agree with you and am now wondering why the heck I’ve used gg all this time.
Re:Vim 9.0 by necheffa on Thursday June 30, 2022 @05:20PM (#31938773)
I mean, I have a 32" 4k monitor for a reason.
Re:Vim 9.0 by bayindirh on Thursday June 30, 2022 @05:41PM (#31938997)
I mean, every column counts, even in a 32" 4K display. Also, not all of us have the space to fit these screens everywhere we work.
Re:Vim 9.0 by avgcorrection on Thursday June 30, 2022 @05:28PM (#31938852)
Reason being outdated indexing UX?
Re:Vim 9.0 by bmelton on Thursday June 30, 2022 @07:37PM (#31940157)
I gave up absolute line numbers a few years ago in exchange for `:set rnu` and while my navigation capabilities (at least to anywhere I can see) have gotten a lot faster, the ability to `>>` a handful of lines without having to count has felt a ton more productive
Re:Vim 9.0 by threatofrain on Thursday June 30, 2022 @08:33PM (#31940625)
You can also set both relative & absolute line numbers at the same time.
Re:Vim 9.0 by I_complete_me on Friday July 01, 2022 @04:40AM (#31943868)
I have this in my .vimrc to toggle relative on/off with ctrl-n:

> nnoremap <C-n> :exe 'set nu!' &nu ? 'rnu!' : ''

Re:Vim 9.0 by Diederich on Thursday June 30, 2022 @05:12PM (#31938681)
Nope. Back in the day that would greatly interfere with copy/paste. One way or another, it's so easy to see what line number you're on and/or jump to a specific line.
Re:Vim 9.0 by theposey on Thursday June 30, 2022 @05:17PM (#31938734)
can't you just yank to +? you might need the vim build with +clipboard if it's not default these days
Re:Vim 9.0 by deadbunny on Thursday June 30, 2022 @06:31PM (#31939540)
I have vim use the clipboard by default, with that said I still use the mouse to copy stuff now and then.
Re:Vim 9.0 by u801e on Friday July 01, 2022 @12:07AM (#31942235)
Depending on your OS, you could use visual line mode and highlight the text you want to copy. Then you can run:

    '<,'>w !xclip -selection clipboard
to copy the text to your clipboard. Macs have another program that works similar to xclip, but I don't remember what it's called.
Re:Vim 9.0 by OJFord on Friday July 01, 2022 @03:51AM (#31943598)
> Macs have another program that works similar to xclip, but I don't remember what it's called.

pbcopy

While I'm here, on Wayland substitute wl-copy (or whatever you use).

Re:Vim 9.0 by xigoi on Friday July 01, 2022 @03:38AM (#31943517)
What's the advantage of this command over "+y ?
Re:Vim 9.0 by u801e on Friday July 01, 2022 @10:34AM (#31946941)
If vim doesn't have clipboard support enabled, then this is one way to copy and paste. The vim packages in the Fedora repositories are configured such that vim doesn't have clipboard support, but gvim does.
Re:Vim 9.0 by OJFord on Friday July 01, 2022 @03:53AM (#31943615)
Not GP, but for me it's simply that I remember it (or rather don't need to, because it's just using general purpose mechanisms that I already remember).

But now you've said it maybe I'll remember if I need it today, and.. well I'll see.

Re:Vim 9.0 by marcthe12 on Friday July 01, 2022 @08:06AM (#31945269)
It's X11 only. So Wayland or remote users can not use it.
Re:Vim 9.0 by AlecSchueler on Thursday June 30, 2022 @05:23PM (#31938807)

    :set nu!
Just toggle them off when you copy/paste, then on again. Takes a fraction of a second.
Re:Vim 9.0 by johncoltrane on Friday July 01, 2022 @11:53AM (#31948215)
Yeah, why enable a feature you never use?
Re:Vim 9.0 by ur-whale on Friday July 01, 2022 @04:17AM (#31943734)
> No line numbers? @_@

Are you still using goto's ?