Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Claude Code now reads AGENTS.md if there is no Claude.md(claude.com ↗)
    136comments
  2. Android 17 is the first since 3.x to add new APIs without releasing to the AOSP(grapheneos.social ↗)
    190comments
  3. Saving another 100TB of RAM(cloudflare.com ↗)
    34comments
  4. Cloudflare Quick Tunnels(cloudflare.com ↗)
    223comments
  5. Xcode 27.1 Beta Release Notes(developer.apple.com ↗)
    59comments
  6. How OpenAI Used Its Own LLMs to Design Its Jalapeño Chip(ieee.org ↗)
    discuss
  7. US troop deaths during Iran war exceed Pentagon count by at least four(reuters.com ↗)
    32comments
  8. Cache-to-Cache: Direct Semantic Communication Between LLMs (2025)(arxiv.org ↗)
    11comments
  9. Photon-Emission-Guided Laser Fault Injection Enables RP2350 Secure Debug(ledger.com ↗)
    45comments
  10. Show HN: Cactus Needle 3: 8-29MB automation models can match DeepSeek V4 Flash(cactuscompute.com ↗)
    72comments
  11. How to Write with an LLM(sockpuppet.org ↗)
    246comments
  12. OpenJev(openjev.com ↗)
    238comments
  13. The first new cat species discovered in 100 years(nationalgeographic.com ↗)
    35comments
  14. Cyclomatic Complexity in C#(ndepend.com ↗)
    9comments
  15. The Implications of Linguistic Illegibility for LLM Security(arxiv.org ↗)
    17comments
  16. Two parallel neural ectoderm progenitors contribute to the developing brain(newscientist.com ↗)
    51comments
  17. C++26: Trivial infinite loops are no longer undefined behaviour(sandordargo.com ↗)
    168comments
  18. From Geometry to Algebra and Back Again: 4000 Years of Papers (2023) [video](youtube.com ↗)
    discuss
  19. Warez: The Infrastructure and Aesthetics of Piracy (2021)(archive.org ↗)
    13comments
  20. Minimal Phone 2(minimalcompany.com ↗)
    150comments
  21. A 1542 papal cipher cracked with simulated annealing(simonklee.dk ↗)
    discuss
  22. How SpaceX streamlined the Raptor engine(construction-physics.com ↗)
    25comments
  23. Inside ZCode: Silently uploading your Git history to the cloud(ferstar.org ↗)
    89comments
  24. A search-and-inference database from scratch in pure Zig(antfly.io ↗)
    16comments
  25. I vibed a proof of Conway's conjecture(overreacted.io ↗)
    175comments
  26. Size-Specialized Memory Allocation(go.dev ↗)
    3comments
  27. The US 'Kill Chain' That Destroyed an Iranian School(bloomberg.com ↗)
    1comments
  28. Korea raises data breach fines to 10% of revenue(koreajoongangdaily.com ↗)
    73comments
  29. Cekura (YC F24) Is Hiring(ycombinator.com ↗)
    discuss
  30. North Korean nuclear test sets off years of earthquakes(science.org ↗)
    148comments

Learn to speak vim - verbs, nouns, and modifiers

208 pointsby 14y agoyanpritzker.com
33 comments
14y agoHN ↗

Useful - I found that mapping keys to actual verbs in my head as I'm using vim really helps the memorization process.

This doesn't exactly work for everything though... I'm still having trouble remembering movement keys (still using the arrow keys instead of hjkl...).

14y agoHN ↗

If you just force yourself to stop using the arrow keys you'll be surprised at how quick it just becomes muscle memory. As far as remembering them until then, I suppose they're kind of like the arrow keys in that left and right are on the outside with up and down in the middle.

14y agoHN ↗

I still use them as well but not for moving though my code. /?fFtT and things like ]] beat both the arrows END hjkl hands down, I think.

14y agoHN ↗

For what it's worth vim has been my main editor now for 2+ years and I still don't use hjkl. I know I should, but I can't seem to get over the hump that I can easily find arrow keys by feel, but not hjkl.

As for remembering them, left and right are on the outside, and 'j' kind of looks like a down arrow (that's how I distinguish j from k)

14y agoHN ↗

You should start using j and k in other places like gmail to start getting used to it. I know it takes some work, but I think it is totally worth the effort.

14y agoHN ↗

You can just remap the arrow keys to do nothing in vim, and within a few days or so you'll be comfortable with hjkl. It's not a big deal - just do this if you want it.

14y agoHN ↗

I've been using Vim for something like a decade, and I only recently started toying with hjkl. At first, I ignored it because I was already pretty good with the arrow keys and hjkl are annoyingly not quite the home keys; then I ignored it because I switched to Dvorak and hjkl are scattered across the keyboard.

Strangely, it was Google+ that got me interested in hjkl, or at least J and K for moving up and down. In the Dvorak layout, J and K are where C and V are in QWERTY, so they're still pretty convenient to reach for.

14y agoHN ↗

This has some mistakes. yt$ is not equivalent to yy - yt$ yanks from the cursor to the end, yy is equivalent to 0yt$

14y agoHN ↗

Actually it's even bigger than that. yt$ does not include the newline, yy does. So p after a yt$ will not change lines, it will insert the content directly on this one after your cursor, while p after a yy will reproduce the entire line as a new line below the current one.

14y agoHN ↗

Are you sure that yt$ will do anything if there is not a dollar-sign character on the line? Neither that or ct$ seem to do what the post advertises.

14y agoHN ↗

The commands the OP was looking for was c$ and y$. They are equivalent to say cw, where the object is "end of line" instead of "current word"

14y agoHN ↗

y$ will yank till the end of line (characterwise). Y is actually the same as yy, unless you n(no)remap Y to be the same as y$, which most people do. This makes make more sense, because C is the same as c$ (change till end of line). ':h change.txt' explains all of this and more a lot better than I could.

14y agoHN ↗

thanks guys, I wrote the post at 3am and that was a bad time to be writing about vim as it turns out :) I've removed the bad examples for now and will go back to the post and add more as I think of them. The general idea was to explain that vim is not voodoo, but is very mnemonic and conversational.

14y agoHN ↗

There's another mistake in that command (also present in the article): with that "t" in there, `yt$` will yank up to, but not including, a '$' character on the current line. Unless there is no '$', which is an error and no yanking. Yank from cursor, not including newline, is `y$` without a "t".

14y agoHN ↗

and capital Y is equivalent to y$. A capital letter for a verb is "do this verb from current location until end of line"

14y agoHN ↗

Y is an exception to that rule, it's a synonym for yy (like S for cc), but easily changed to match D and C.

14y agoHN ↗

Ah wow, you are correct. Any good reason that is the default behavior for Y?

14y agoHN ↗

These kinds of blog posts always forget the 's/S' (substitute) operator. I find it super-useful.

14y agoHN ↗

it feels like the substitute operator doesn't follow the sentence conventions. you can't saw (substitute around word) or anything like that. it feels like a standalone bit of functionality. I was trying to express reusable bits in my post, things you can build on and expand. am I wrong?

14y agoHN ↗

I am ashamed to say that this made me giggle like a girl.

I guess I'm the kind of guy that understands and learns in this way better than seeing visual cheatsheets or long-winded reference pages. Up until now I've just been remembering particular sets of vim commands but this will really make me a lot more productive I'm sure. :)

14y agoHN ↗

I am not fully vim fluent, but I found this presenting angle confusing at best.

Perhaps it helps to remember more easily if one already knows and uses all the basic commands. Personaly I don't use vim all the time and have trouble keeping a good mental model of the different commands behaviour depending on the state of the document.

Telling me "hey, y is not some command acting against a state, it is a verb, just use it with nouns like you use verbs!" is just counterproductive.

completely off-topic, but I had a hard time to visualize how it is to "giggle like a girl". Even googling and youtubing left me puzzling at the exact way to giggle you wanted to express. It is kind of fun and curious.

PS: responded to this post for the OT bit. not that it was a direct reply.

14y agoHN ↗

I agree. This article helps me understand why Vim has been so fun for me to use.

I guess I have been doing this naturally for years and didn’t realize it till just now. It’s almost a telepathic connection; just think the word and the computer responds.

Beautiful.

14y agoHN ↗

If this gets people into vim and helps them understand some of its craziness, that's awesome. However, like previous commenters have pointed out, most of these examples are actually wrong (not by a mile, but it pays to be precise in vim). Also, even though I love browsing through dotfiles and plugins on code repository sites, I tend to think that beginners to vim should learn slowly, gradually, and build up their knowledge over time, like anything else. Diving into plugins and custom mappings right away is going to be a lot more painful and less productive. And that's the antithesis of vim.

14y agoHN ↗

sorry, made some mistakes late at night. but "most" examples wrong? I think I only screwed up on the $ examples. if you see anything else wrong can you please point it out, so that I can fix em and not mislead people, thanks!

14y agoHN ↗

I'd been familiar with the concept of verbs and nouns in vim but this really simplifies it all. I wish there was a more comprehensive list of everything in a readable format. Man pages just don't do it for me :(

14y agoHN ↗

I'll try to expand the post as I internalize the learnings myself. I'm no vim expert, I just find that explaining it to others helps me solidify my own learning

14y agoHN ↗

I have that wallpaper with a green background on my wall. I think the author posted it here a few months ago.

14y agoHN ↗

Is there any way to use a / search as the target object with these sorts of commands? I'd like for instance to be able to type ct/foo<cr> and have it delete to the next instance of foo and put me in insert mode. Or something along those lines.

14y agoHN ↗

/foo<cr>c`` may be what you're looking for (see :help ``)

14y agoHN ↗

Simply c/foo should work, if I understand you correctly.

14y agoHN ↗

Oh thanks, for some reason I thought I tried that before and it didn't work. Awesome.