How do you use Vim in the era of AI?
23 points
1 hour ago
| 30 comments
| HN
I'm a heavy vim user, but now that I look at the code less and less I'm wondering if it still makes sense.
ramses0
59 seconds ago
[-]
It makes sense even more. If you never enter "insert" mode, you still have powerful navigation and overview capabilities. `*`, `#`, n/p, :set fdm=indent + zM/zR, gf/gx, :bp, the venerable `}/{` pairing, and simply `C-n/C-p` while composing prompts can be useful.

AI + Prompting can get you there, but it's still fairly laggy. Honestly, VSCode (aka: Cursor) w/ the vim plugin, and `F2-rename` has been the sweet spot for me. Reviewing diffs with `git diff | view -` and browsing them with vim is another useful.

:wq

reply
cryo32
21 minutes ago
[-]
I’m not using any AI. A lot of us aren’t. Vim has done me well for 30 years so I’m not going to throw that away to sharecrop on someone else’s land.
reply
shhsshs
9 minutes ago
[-]
I see coworkers reach for AI to perform many tasks that are made trivial by a few keystrokes or a simple macro in Vim.
reply
eddd-ddde
3 minutes ago
[-]
Your macros are not implementing features, fixing bugs, and writing test cases.
reply
Leonard_of_Q
4 minutes ago
[-]
"how do you use an ax in the age of AI"

Exactly the same as I used it on the age of frameworks, the age of Java and .NET, the age of compilers, the age of ...: you take it by the helve and swing the business end towards the object.

reply
jillesvangurp
7 minutes ago
[-]
I've barely touched Intellij for the last half year or so. I rarely edit code manually at this point. I also did not renew my subscription and am back on the community edition.

I've noticed that my preferences for tools and languages is shifting as well. I'm happy to work with stuff that I previously would have not touched now because it would take me too long to get up to speed with languages, frameworks, etc. That stuff no longer blocks me from being productive. I still care about code quality, good design, etc. but a lot of that stuff doesn't require me to micro manage a code base. In the rare case I want to open something in an editor, I use vs code. I've removed a lot of the plugins in that as I'm not really using them any more.

I actually do reach for vi on the command line sometimes. But I've never been very good with it. I know how to do simple edits and save the file. I just never really got into it. I memorized a handful of key bindings somewhere in the nineties and that's it. I know some people that live in this editor and swear by it but for me it's just something that's there by default that is vaguely useful in a pinch if there's nothing else.

reply
redlewel
29 minutes ago
[-]
How are you a heavy vim user if you wonder if vim makes sense with ai? There are so many things to do outside of writing code that vim is used for.

Also neovim + claude code + open terminal pane in tmux is the goated combo anyway. Especially more lately you need to understand the code you are writing if you want to do anything important in software, and the best way to do that is neovim :)

reply
c-hendricks
2 minutes ago
[-]
copilot.lua, CodeCompanion when I want in-editor agents (hooked up to OpenCode), OpenCode web for most everything else. Neovim works fine in OpenCode web's terminal too.
reply
anonymid
24 minutes ago
[-]
I wrote my own neovim AI harnesshttps://github.com/dlants/magenta.nvim

And wrote about my thoughts on the relevance of nvim here https://dlants.me/ai-whiplash.html

It's been many months, and I thoroughly prefer my harness inside of nvim as my day to day development environment. Using Claude code or cursor makes me feel very removed from the code.

Exploring code, gathering context and tweaking prompts/giving guidance to the agent are very much enhanced by neovim.

The biggest boon has been the fact that agents make customizing neovim a lot easier. Writing new bindings, config, and even building novel plugins.

Here's a few that I built that fit into my workflow:

- a tool for reviewing commits / branches / wip. https://github.com/dlants/glean

- an iterative grepper https://github.com/dlants/shuck

- a file picker that renders in your current window (like oil) and uses more intelligent signals for ranking (like frecency) https://github.com/dlants/needle

reply
MantisShrimp90
30 minutes ago
[-]
(Neo)vim is setup wonderfully for this era. Im with Justin on the take that neovim can replace tmux soon literally all that is left is being able to restart terminal sessions on restart (which is even set as a goal for summer of code).

Neovim can already have all the agents running in different terminal buffers or there are plugins popping up every day to have deep integrations with your favorite or we even have some interesting harnesses that are unique to neovim like sidekick.

As always, the ability to compose small tools and edit any file allow neovim to stay relevant and more powerful than ever in my opinion while not forcing workflow changes like the others

reply
fernandotakai
35 minutes ago
[-]
like normal?

but i don't use ai to write code for me -- i use it as a companion thing where i ask questions and then, instead of asking for code, i implement everything myself.

it keeps me sharp and helps me understand the lastest ai stuff.

reply
galoisscobi
20 minutes ago
[-]
I use jj vcs and now most of my time is spent reading the code, so I use diffview.nvim (https://github.com/sindrets/diffview.nvim) with some customizations for jj to read diffs. I also use the snacks picker/explorer to search for code.
reply
wffurr
50 minutes ago
[-]
Use it to write and edit code when that makes sense for you to do so. Just like you always have. It's an extremely useful skill to have even still.

I've had much more success with agents reviewing my code and offering inline autocomplete over LSP than I have with letting the agents write the code, which I then try to review. I end up with a much better mental model of the code and higher quality output than either I or the agent could do alone.

reply
chikinpotpi
33 minutes ago
[-]
I use vim and claude code (fable) inside of herdr.

I can jump to one tab look at the code, jump back over and talk to claude for a little.

I can spread this all across several projects using herdrs workspaces.

I still write code when it makes sense.

Sometimes i annotate the code with comments, hop back over and ask the LLM to consume the annotations i just added and make changes.

Sometimes i ask the LLM to analyze lots of code, and come up with a plan of attack for me, then i go implement it myself.

For Personal projects I write much more of the code myself still, because i enjoy it. For work, i do whatever gets the best outcome most efficiently.

reply
Havoc
12 minutes ago
[-]
I usually have tmux with two tabs - one opencode one neovim (and a third for cli )

Definitely not a vim power user though. I just like writing markdown spec-ish prompts and opencode simplistic input box isn’t ideal for that

reply
ventana
23 minutes ago
[-]
I don't think anything has changed for me regarding my vim usage. Previously, I would use vim to make simple changes in the code or configuration files, making larger changes in VS Code. Now, with agents, I never need to make larger code changes manually so I completely ditched VS Code, but I keep using vim in the same way as I did before: for small changes which I want to make manually, for editing configs, or as a scratchpad.
reply
porridgeraisin
1 minute ago
[-]
Funnily enough, I have my agent use vim sometimes.

I prefer commits to be granular to the extent that I manually edit the patch in git add -p, albeit rarely. So I have a pty plugin that my agent literally sends control codes to. This is also useful in general for LLMs driving any interactive terminal program. Long live text, I guess.

reply
ActionHank
50 minutes ago
[-]
You're not looking at the code?
reply
mrweasel
27 minutes ago
[-]
I'd even go so far at to say that if you're not writing the code yourself, you probably need to look at it even more than previously.

Even before AI most of us read way more code than we wrote, that should still hold true.

reply
classified
8 minutes ago
[-]
You're ignoring that AI coding attracts a whole new crop of people who would never have touched computers before. We live in interesting times.
reply
derwiki
18 minutes ago
[-]
Codex has /diff to review the code, or you can look when it’s a Pull Request
reply
avsn
35 minutes ago
[-]
Usually I keep terminal split open with the agent side by side and make edits by hand where needed or for reviewing the code. Inside the vim itself I have a small plugin that you can feed a block of text with the comment instructing LLM what to do. It then replaces the text with the result of execution. Super useful for small edits here and there that don't require full session. I also have preconfigured neoterm float with the pi agent, that allows me to jump into the session right away.
reply
Aperocky
34 minutes ago
[-]
I am sort of a no UI (except browser) user for a very long time now, and vim is still incredibly useful.

Granted, the language servers are getting dusted, but it's much nicer to write goals in markdown in vim and send it to LLM in a self-written harness CLI; and even look at the results in the same way. All unix. LLM is just the latest toolbox addition.

reply
throw2ih020
43 minutes ago
[-]
I switched from using Vim as my primary editor to using Zed's Vim Mode. When you have a second process editing your project in the background you need an editor that can display those changes immediately without clunky buffer reloads.

I've also customized Zed's UI to optimize for reading and reviewing code, and mostly adding notes or small focused edits, rather than writing entire files from scratch.

reply
carlinm
17 minutes ago
[-]
I’ve done the same. Curious, what changes have you made to optimize the reading and reviewing?
reply
chadash
40 minutes ago
[-]
i use vim quite a bit! I find that in this new era, i'm in the command line a lot and like to stay in the command line. vim (I use neovim) is a good way to do that.

Furthermore, a lot of my workflow is now done on remote servers (i love exe.dev) where claude code is sandboxed to an extent (it can still cause damage, just not to my main computer's file system). When I'm configuring those, i have a setup script that installs all of my vim files just the way i like them, so vim behaves exactly the same on a remote server as it does locally. I can edit things as needed. I can also access claude code on those servers as well. So working on my remote machine feels a lot like workin locally [1].

[1] I'm aware that i can setup cursor or vs code to access SSH servers, but it's just not as easy and doesn't feel as natural, IMO. There's something i like about needing to call `ssh remote-server` first.

reply
mtklein
48 minutes ago
[-]
On about day 2 of using Fable I realized that the .vimrc I'd been maintaining for 15-20 years would probably never change again.

With Opus I still feel like I'm pair coding and want to get in there and make some changes myself, but working with Fable (even Fable managing Opus agents) had me in a completely different mindset, one where I realized I would just be getting in the way.

reply
linsomniac
25 minutes ago
[-]
A couple years ago I decided to stop maintaining a .vimrc (after ~35 years), and started using LunarVim and later AstroVim with as few customizations as I could live with.

But then around 2 months ago I decided to switch to NixOS and there wasn't a Nix way I could find to use Astro. So I had Opus build me a vim setup for NixOS that included the batteries I wanted in my setup. I gave it a paragraph description and it built something that has been a joy to use.

reply
fullstop
20 minutes ago
[-]
This makes me sad. We've lost something.
reply
ArcHound
42 minutes ago
[-]
I did a write-up at https://blog.miloslavhomer.cz/vibing-with-french-models-in-n....

It really can be a fancy auto complete, but more agentic usage moved out of the editors (and I think that's a good thing).

reply
philipportner
34 minutes ago
[-]
Hasn't changed at all since AI agents became a thing. tmux, nvim with a few plugins, mainly fzf and LSP support. If I do use an AI agent, I just run it in another tmux window.
reply
elzbardico
4 minutes ago
[-]
Vim helps me ground my AI usage to my workflow. It is so pleasurable to edit text with Vim that it keeps me writing skeletons for the AI to fill according to my design instead of delegating design to the AI.
reply
hsaliak
11 minutes ago
[-]
I have my own coding harness (std::slop), in that i focus on a vim centric flow. Basically a few commands open. up my $EDITOR which is vim.

1. /edit => opens in editor

2. /feedback => opens the last llm message in an editor so i can inline feedback. Think inline responses in email vs bottom posting.

3. /review => same as /feedback but opens up the diff so i do an inline review. Yes I still read the code it ships.

So basically in this flow vim becomes integral to doing anything involved.

reply
hjkl_hacker
40 minutes ago
[-]
I still use Vim, but totally different from before. I don’t care about efficient movement/editing bindings. All I use it for now is navigating and viewing files.
reply
linsomniac
40 minutes ago
[-]
^G in Claude and Codex will drop you into $EDITOR to edit your prompt. I use that all the time.

"vimdiff" is a really great way to review code changes side-by-side.

reply
vslira
42 minutes ago
[-]
I use it to write instructions, obviously. I thought everyone was using C-g on Claude Code
reply
deadbabe
16 minutes ago
[-]
Vim/Neovim have only grown more powerful in the age of AI, not less. I am certain that even 30 years from now developers will still be using some form of vim.
reply
simianwords
47 minutes ago
[-]
The intersection of people who like vim and ai is basically nil
reply
perplex
32 minutes ago
[-]
My Neovim + AI workflow is running Neovim (LazyVim) and Claude Code side by side in a terminal split. As the agent makes changes, I review them in Neogit. I don't really make edits by hand much anymore, but the keyboard is still how I navigate the code when doing reviews. I can jump to references, open files, read through the diff very quickly with keyboard shortcuts.

The Neovim/LazyVim speed for writing code turns out to be just as fast for navigating and reviewing code.

reply
cliff_badger
16 minutes ago
[-]
I'm trying to figure out who you're trying to slight...

Either way I'll happily be part of your `nil` category.

reply
snaveen
43 minutes ago
[-]
There are few people.
reply
Apreche
42 minutes ago
[-]
Can confirm. Using vim same as always. Do not use any so-called ”AI” whatsoever.
reply
apodik
43 minutes ago
[-]
that is untrue
reply