Live data from Hacker News

VIM Master

github.com

111–120 of 123 posts

Re: VIM Master

#111
post #82

Earlier quoted context omitted.

> I’m still not even a vim master. I can do some things that people using vim for decades didn't know was possible. I'm still not a vim master. How does one ascend to the levels of TPope? Joking aside, I think that's one of the nice things about vim. There's always more to learn. Not in the way that you're missing something but in the same way this is true for any programming language. It's because these tools are so…

Vim isn't an editor, it's an interactive programming language for text processing. :%norm 0f"ldt"i... There are so many times (even per day) where I'll say to myself: "ahhh, I'll just 'vim' it rather than writing a program..." If I'm not going to have to do it a bunch, sometimes vim itself is faster than writing a script to do whatever random task I need done.

I have also used vim macros to do all sorts of text formatting that would have otherwise taken ages!!

One time my girlfriend needed to format a bunch of text, I don’t remember why. It was like a csv but couldn’t be opened in excel because it was badly formatted or something?

Anyway her work computer had vim on it, and I totally saved the day. Pretty much the proudest moment of my life lol. It was like this xkcd, but for vim https://xkcd.com/208/

Re: VIM Master

#112

Earlier quoted context omitted.

Here is a possible way to do it sending the current buffer to the standard input: :%!ai-cli

I guess that's one way to do it, but not the best possible UX of course.

Good UX matches expectations. Vim trades easy defaults for adaptability, therefore the expectations are different.

Re: VIM Master

#113
post #108

https://www.vimgolf.com/ is also cool, but I find that it doesn't really help with muscle memory as much as learning cool tricks.

I think it requires a twitter/X account. Why?

I also see a Login Via GitHub, but there could certainly be scope to allow local accounts here.

Re: VIM Master

#114

Learned vim with a game like this. It was a vscode extension, I don’t remember what it was called. Anyway it’s easily the best time investment I’ve ever made, period. Takes a couple days of messing around, and you can basically never leave modal editing behind! It’s just so much better. I’m still not even a vim master. Just the basic motions and commands are enough to never want to give em up. Throw macros and regist…

Searching for "vim game" this is the only thing I found: Vscode Vim Academy https://marketplace.visualstudio.com/items?itemName=kaisun.v... Does that look like what you used?

ok actually upon closer inspection, the extension was not a game, just a "learn vim" type of thing. I think I got it mixed up with a vim game I found online.

https://marketplace.visualstudio.com/items?itemName=vinthara...

Re: VIM Master

#116
post #82

Earlier quoted context omitted.

Vim isn't an editor, it's an interactive programming language for text processing. :%norm 0f"ldt"i... There are so many times (even per day) where I'll say to myself: "ahhh, I'll just 'vim' it rather than writing a program..." If I'm not going to have to do it a bunch, sometimes vim itself is faster than writing a script to do whatever random task I need done.

I have also used vim macros to do all sorts of text formatting that would have otherwise taken ages!! One time my girlfriend needed to format a bunch of text, I don’t remember why. It was like a csv but couldn’t be opened in excel because it was badly formatted or something? Anyway her work computer had vim on it, and I totally saved the day. Pretty much the proudest moment of my life lol. It was like this xkcd, but…

I have that shirt! ;-)

The other day (we're being encouraged to "use AI" at work), I had a bunch of 20250101, 20250201, ... fields in a g-sheet at work. I decide to ask google's AI to "help out", hey... can you convert these integers to ISO date strings?

"Sure can do, old buddy, old, pal, here you go, it's '2025-01-01', '2025-02-01', etc..."

OK, great, can you put those rows into the spreadsheet now? "Whoah whoa... I used python code to do that for you" => "Can you do it with a spreadsheet formula or something? Can you replace those rows? What's the formula to convert this into a string / iso date? ...etc..."

Finally I'm just like "fuck it!", grabbed it in vim, `Ctrl-V, G, I-, ll.` and pasted it all back in. Like 10 keystrokes instead of arguing with our new robot overlords. :-D

Re: VIM Master

#117
post #109

When I was learning Linux back in the day, one of the most beneficial thing I did was to go though the VIM tutorial and learn to use it properly. I'm no master at it but oh boy that time spent has paid dividends down the line.

The Neovim Tutor is more comprehensive than the old school Vim Tutor. I recommend that people who want to get fast with the key commands go through it repeatedly until most of it becomes part of their muscle memory. When this happens, the learning curve starts looking a lot more approachable and less daunting.

Re: VIM Master

#119
post #76
post #57

Earlier quoted context omitted.

:wqa is the same as :xa and is probably easier to remember

Are you sure? IIRC :x only writes the file again if there's a change where :w(q) always writes again (which takes longer when editing a remote file via scp://). For a non-exiting version of :x there is :up. I bound :up to fs after I learned about it. I used to have :w on the same keybind so it was a straight upgrade. Now I can just quick hit it at any time and there's no waiting around if the file hadn't changed. Sav…

Yes, through ":help wqa" which lists it as such and double checking with a quick test. It doesn't write unchanged files, same as :xa instead of being an exact "all" version of :wq
Post reply on HN