Hacker News new | ask | show | jobs
by RobKohr 393 days ago
I use Cursor as an agent and sometimes I use autocomplete. Both tools are dependent on what you are doing at the moment. I like autocomplete when I am focused in tight on one file. I spell things out in depth in file and start out code and hand pick completions. It brings my mind in sharp on what I am doing. Agent is when I am doing big but simple stuff where I am crafting less in detail. Refactoring and setting up tests and basic shallow framework code.

But this article is on point. All of things listed are more impactful than LLMs

1 comments

I've been using vim forever, and often use "advanced" editing techniques: macros, .-repeat, :g/.../norm ..., occasional templates.

For certain projects I'd used `vscode` (with the vim plugin!), and there's definitely some helpful bits. The biggest helper for me is/was the `F2-rename-symbol` capability. Being able to "rename" securely in the whole file (or function), and across the project is super-useful.

Working with Cursor and the autocomplete is (often) pretty shockingly good. eg: when I go to rename `someVar` to `someOtherVar`, it'll prompt to `<tab>` and:

  * rename the function call

  * edit the log lines

  * rename the return object value

  * ...etc...
In vim, I'd `*` to automatically search for `someVar`, then `cwsomeOtherVar`, (change-word), then `n.n.n.` (next, repeat, etc.)

...so my overhead (by keystrokes) is `*` (search), `cw` (change word), (`n.`) next-and-change. Five "vim" characters, and I mentally get to (or have to) review each change place.

In straight `vscode`, I can do `F2-rename` and that'll get me replace _some_ of the variables (then I still have to rename the log lines, etc).

With Cursor, I make the `cw...` and it's 90%+ accurate in "doing what I probably also want to do" with the single `<tab>` character.

It gets even more intriguing where you'll say `s/foo/fooSorted/` and it automatically inserts the `\*.sort()` call, or changes it to call `this.getFooSorted()` or `this.getSorted( foo )` or whatever.

For "cromulent" code, cursor autocomplete is "faster than vim". For people that can't type that good, or even that can't program that good, it's a freaking god-send. Adding in the `Agent...` capabilities (again, for "cromulent" code)... if you're just guiding it along: "Now, add more tests" => "Now 50% more cowbell!" => "Whoops, that section would be more efficient if you cached stuff outside the loop."

Even then, I have to have some empathy with the AI/Agent coding, "Hey... you messed up that part (btw, I probably would have messed up that part the first time through as well...)". We can't hold them to gold standards that we wouldn't meet either, but treating them as "helpful partners" really reduces the mental burden of typing in EVERY SINGLE CHARACTER by yourself.

I'd describe myself the same as you did in your first paragraph here, and wanted to say that with LSP, your "rename function call" example in vim (well, I switched to neovim some years ago) is (mostly) `<Leader>rn` (default in my LSP setup, I'll paste the relevant line below) when the cursor is on the symbol. That will change the name in all open buffers. Annoying thing is that it doesn't (ofc) change the name in "log lines", so it's helpful to pre-`*` on the symbol name so you can go back and `n.n.n.`. (I've always wanted to "wire up" something to also detect those log lines and change them at the same time, but... ya know.)

The line in my nvim config that sets up the LSP "rename" is:

  vim.api.nvim_buf_set_keymap(0, 'n', '<Leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
I mention this because in spite of using vim/neovim for over 20 years, I still learn new things (from HN comments and elsewhere) -- which is part of why I love it.

(To your larger point -- I concur... btw)

I don't know if you've ever messed with `ctags`, but I used that a long while back with a crufty, large, PERL codebase.

It was super nice to have "jump-to-definition", but the vim plugin in vscode is very nice (missing a few things, but even `<c-w>hjkl` "does the right thing(!) so they're really trying).

I haven't leaped to nvim (yet?), and the fact that vscode kindof "just works" has prevented me from chasing LSP support or setting up the more "advanced" features, but thanks for sharing!

I'd be fantastical if something similar to that cursor autocomplete were available in a "real" cli-vim. There's things that really bug me about the "hover suggestions" (eg: can't always tell which characters/lines are "real" or "suggested", especially with auto-closing double-quotes suggestions), but when I occasionally drop to a terminal vim for "accurate" editing, I really do find myself missing like "I should just be able to tab-complete the rest of these edits..." and I don't know how to express that in an appropriate "editor" context?

Maybe lean on like a `vimdiff` representation, where you could `:vsplit $ASSISTANT` and accept suggested diffs? (Hmmmmm....)

> In vim, I'd `*` to automatically search for `someVar`, then `cwsomeOtherVar`, (change-word), then `n.n.n.` (next, repeat, etc.)

There's also:

  :%s/someVar/someOtherVar/gc
The "c" at the end is for "confirm", vim asks whether to change each one and it's a single "y" or "n" before going to the next.
In most cases changing a symbol globally is one find -exec sed incantation, but it's also basic functionality of many IDE:s and LSP:s.