‹ BackHN Continuity

Thread

Small programming tricks

681 points · 294 comments · signa11

  1. kccqzy · · focus · HN ↗
    A lot more tricks can be learned from just watching AI work. Instead of allowing AI to work autonomously, go back to the old days where you manually approve every command the AI runs. Just recently while doing performance optimization work, I found Opus using the `perf` command in ways I didn’t know possible. Just give AI a real task and carefully read what commands are used by the AI to solve the problem; most likely the AI uses a trick or two that you didn’t know existed.
    1. throwaway219450 · · focus · HN ↗
      There are several keyboard shortcuts that you would never find out from watching an agent, but are mindblowing to new Linux users. I suck at remembering vim keybindings, but I have ingrained ctrl+a ctrl+e for jumping to the start/end of a string (which also works all over OS X). I had been a developer for an embarassing amount of time before I discovered those.

      There are other terminal specific shortcuts for removing last word (ctrl+w) but they don't seem to be as portable.

      1. sprinkly-dust · · focus · HN ↗
        The OS-wide Emacs bindings are one of the main things still keeping me on macOS; in editors like Helix (or Zed with Helix mode) I invoke these really cursed combinations of the Helix(vim-like) shortcuts in the editor with the Emacs ones from the OS and it feels really natural as a means of moving around text.

        I haven't put in enough effort to replicate the experience on GNOME but once I jump ship from Apple I'll have to.

        The way macOS treats shortcuts thanks to the separation of Command and Control is great. It even makes Google Docs pretty painless to use because it's mostly like Emacs. Word still tries to hijack the shortcuts so that's suboptimal.

        1. ifyoubuildit · · focus · HN ↗
          I think gnome just had this as an option somewhere. Asking chatgpt says that this was removed in GTK4, so maybe it's no longer a thing?
          1. cirelli94 · · focus · HN ↗
            I can still do everything in gnome with a shortcut, but not in vim style.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.