Hacker News new | ask | show | jobs
by ratrocket 398 days ago
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)

1 comments

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....)