How do you use Vim in the era of AI?

2 points by rstagi ↗ 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.

88 comments

[ 2.2 ms ] story [ 59.5 ms ] thread
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.

You're not looking at the code?
[delayed]
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.
That's fair, but I wouldn't think those users would be using vim either (probably vscode)
Codex has /diff to review the code, or you can look when it’s a Pull Request
Codex can also delete all your files if you ask it to.

Just because it can do it, doesn't mean that it's a good idea.

Crazy to me that people are producing code they don't read, expect another human to review it or just let ai take the wheel and review. Then yeet it out the window into prod.

Why are we not ok with this for our cars, but we are ok with this for our software(banking, health care, etc.). Doesn't make any sense to me.

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.

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.

This makes me sad. We've lost something.
Yeah it makes me sad too. It's a one-way veil, no going back once I experienced the new magic.

Sometimes I pop back into a terminal, mkdir, git init, crack my knuckles to do some all-natural hacking and the sadness sets in before the hour is up... "why am I insisting on doing this the long way? I know this project would be better with me in a different role now."

Coding for me has always been a balance of process and ends. Getting done what I wanted done mattered most, but I can't pretend that I didn't also enjoy being the moving parts of that process. And I am most grateful for what I learned by throwing myself over and over against problems I didn't quite know how to solve. There's a satisfaction to doing a thing well that I always love being a part of, still do, anything, even doing the dishes or laundry.

And just recently with Opus I found myself having some really joyously manic days and weeks, making calls, picking tech, designing APIs, insisting on quality, keeping agents spinning. But Fable just kind of came in with "oh, I can do that all for you too. You can relax," and that was both exactly what I wanted and what started making me realize this had all finally caught up to me.

I never wanted to be management, but I can't unsee that I am more effective now playing Fable's boss than I was the last few months as TLM of a squad of Opuses, and that was more effective than just coding myself the way I love.

The intersection of people who like vim and ai is basically nil
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.

I'm trying to figure out who you're trying to slight...

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

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 done the same. Curious, what changes have you made to optimize the reading and reviewing?
Mostly moved my panels around to emphasize navigating code and looking at diffs side by side. Less emphasis on terminals, task runners, debuggers, test suites, etc. - I can pop those out if I need them, but usually I have the agent run my CI suites as a pre-review step anyway.
I use it to write instructions, obviously. I thought everyone was using C-g on Claude Code
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.

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

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

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

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.

I've taken a look at herdr and I am confused, what does it offer over using Blink terminal from iPhone and tmux on the server?
Not familiar with blink but I use tmux heavily. Tried herdr but did t stuck. The main selling point is the status report: tmux requires a plugin and even that doesn’t work as good as herdr. By reporting I mean that while a tmux plugin can report a very basic “status” in the powerline, herdr does so natively in greater detail (reports if the agent waits for use input etc). All solutions I came across with status report might support one agent / cli app and not others… so there is that.
(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

What you’re saying is super interesting, I’ve been using my setup for so long I might have missed some of the latest updates. I spend most of my time on TMUX with Claude Code and vim side by side btw, but I’m using it just to search some specific code and making small changes. I mostly review on GitHub PRs tbh
Any tips on how to switch from Tmux to pure neovim?
I have one: don't.

Tmux is basically perfect software. It gets right out of your way.

It'll never come out of my development stack, or workflows.

Writing code isn't everything. Almost every time I start an apt command or something that might run a little while, I regret it if I'm not in a tmux session.

I could sooner do without vim than tmux.

Vim (and the neo-thing) have multiple plugins that support vim-terminals but for agentic workflows tmux (a specialized tool) and similar tools (there are quite a few nowadays) are way better.
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 :)

neovim + claude code + open terminal is exactly my setup! But all the heavy lifting I used to do simply I’m not doing it anymore. I spend most of the time creating new worktrees and reviewing code, and I guess I’m just not interested about the implementation details that much (not that I don’t look at the code, but minor styling things I just ignore them right now) I’m transitioning to this new way of work btw, so I still haven’t made up my mind. That’s why I asked for someone else opinion here :)
> neovim + claude + tmux is the goated combo

It absolutely is. I don't really understand why people still confine themselves to a full IDE when doing "agentic programming".

Especially with neovim with something like fzf or ctrl-p, which lets just quickly navigate codebases. This is about as far as you need to go. So to me, being terminal-first and being able to do multiple things at once makes more sense (hence tmux).

What exactly can you do with neovim tha I cannot do with vim? :-)
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

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.
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.
I see coworkers reach for AI to perform many tasks that are made trivial by a few keystrokes or a simple macro in Vim.
This is patronising. We know what macros are. There’s benefit in general, adaptable tools, even if some tasks can be accomplished with something more rudimentary. That’s not the point. Hell, the software that you’re so proud of writing with vim could very well be superseded by someone using an LLM to do it in a worse, more wasteful way. But it’s the tool that’s there, and it’s the tool that they use for everything else, and it more easily ties into their workflow.

Comments like this are increasingly just the sounds of someone sticking their head in the sand.

Does that answer the question? Or can you just not help mentioning that you don’t use AI? Because if so, congrats! I’m sure you’re very proud of yourself.
It does if you read deeper into the answer. They are two different worlds.
It literally doesn’t answer the question. “I don’t qualify to answer” isn’t an answer. Don’t tell me to “read deeper”. We are all reading the same comment. You aren’t more intelligent than anyone else here.
Rejecting the implied premise is a legitimate answer
Q: How to properly grill a steak? A: I'm vegetarian; do not eat meat. Completely irrelevant for the question asked. But I do feel the need to express how superior I feel about it.
"I'm not using any AI."

Nor am I

This seems to trigger snarky replies on HN, including personal attacks

Every day HN readers are forced to read endless submissions and comments that amount to "I'm using AI". Great, thanks for sharing

A single commenter remarks, "I'm not using AI". A slew of smarky replies ensues, including personal attacks

How do we explain this

These nonsensical "arguments" with non-believers feel like what we saw with cryptocurrency before SBF went to prison

Cognitive dissonance from being confronted with evidence they're not actually speeding up, when us non-AI devs are only having issues with managers pushing it from above even though we're not actually falling behind?

I also use vim and don't use AI.

'a lot us' you say? just speak for yourself so at least you will sound confident; all you've demonstrated here is your ignorance of LLM, and those who use it, and you amplify that by throwing silly examples to prove your ignorance.

llm usage or not, code browsing/refactor etc still need human usable tools like vim/git/tmux etc.

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.
jj with agentic coding is really underrated. The automatic committing is awesome for being able to see diffs between every prompt, roll back changes done by a given prompt, etc.
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.
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

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.