neovim plus a couple extensions plus some Unix command line tools are just so simple and convenient.
vim's "design decision" to have extensions and external tools that you need to manually string together somehow is just as infuriating.
Regarding your specific examples, both vim and emacs have file histories and if your files are under version control it's easy to get diffs.
Searches are super powerful in both vim and emacs, and it's easy to search across multiple files as well using various scripts/plugins.
The main downside to using editors like vim and emacs is that you have to be a pretty advanced user of them and spend a lot of time configuring them to really feel their power. If you've just dipped your toes in they're not going to look very impressive and you'll likely be disappointed.. but invest the time and they're very hard if not impossible to beat.
One notable exception is that neovim has treesitter, so you get immediate semantic analysis on your code which allows for much more flexible refactoring. Like everything in vim, you need to spend time setting these things up to streamline your common workflows.
Having a good debugger integrated with my code editor is basically the reason I use an IDE instead of vim. Stuff like Vimspector exist but are way more work to use vs. a GUI equivalent.
The sole exception in my opinion is remote debugging (it’s not too bad, but JetBrains really bootstraps this part very well).
I have a (maybe overbroad) critique of GUI software which is that it mostly brought us pixel-level graphics at the cost of extremely restrictive UX. Or said a different way, GUI apps look better but they're usually harder to get work done in.
Part of that is toolkits, part of that is you're using a mouse which is like driving a space ship with a single finger, part of it is the expanding user base of computing (to people who don't necessarily want to learn say, regular expressions). But like, I script GDB. If your IDE debugger won't easily let me do that (or it will but it's a painfully convoluted UX), it doesn't really matter to me that it (subjectively) looks nicer.
> I don't quite remember something and having the internal file history with a diff readily available.
You're already in a terminal, git is just one command away
> Some of the click and find implementation/usages never seems to quite there to me.
This really depends on the language you are working in, but generally vim's gd (and plugins that augment it) enough most of the time, otherwise grep/rg if you know what you are looking for. If you are using something really dynamic, e.g. ruby, then you're pretty much shit out of luck.
> I could go on, if you're truly being productive and not missing out on feature, more power to you.
Here's the thing, the best part about it vim is that it is not slow (plus paired with a terminal emulator like kitty/wez/alacritty). When I type the characters actually appear on the screen as I type them. With most IDE's (at least the ones I have used) there is a noticeable delay from when I have stopped typing and characters appearing on screen.
Another thing to add is that vim is very fast to start up and shut down, I open and close vim multiple times as I am working. With an IDE, startup times are atrocious and dont really fit my work style of cd'ing somewhere quickly editing something, cd'ing somewhere else and rinse and repeat.
In general I find the original command line tools to be much better than IDE provided equivalents or integrations, there's no unnecessary animations and much less cpu/ram usage. Though one exception for me is the database clients, where I much rather prefer a GUI than using the CLI client.
Your tests are already runnable from command line (assuming CI is setup).
Basically, Unix becomes your IDE
I just noticed that ~/.vimrc adds a small delay, even if it is empty. This is the test case:
Create a file with about 10 emtpy lines and type:
esc switch to normal mode
gg go to the top
ctrl + v, G select all lines
shift + i switch to insert mode
- line just type something
esc this will duplicate the first line until the end of the file
If you repeat the test case with no ~/.vimrc, you will notice that the lines are changed faster.Great quote. Perhaps one of the best arguments for using Vim
Editor + shell + tools is the IDE. And I like that I can swap out tools as necessary.
I've rarely had a problem with search, I can type `:grep [some regex]` and I'm quickly shown all matches for that regex in the entire project. I admit I'm not sure how I would do a more complicated query, but this is almost always enough, what kinds of queries do you do which this doesn't cover? There's just one exception, I'm currently working in a codebase where members have very generic names, `Nonce` is a valid field name for a number of different structs, which makes search results for `Nonce` tedious to work through. For this situation I've added a keybinding which calls semgrep and lets me view all references for a specific struct's `Nonce` field.
Calling out to semgrep is an instance of a more general pattern: Because vim is not integrated I lean on tools outside of vim when necessary. The `git` cli, especially once you add some aliases, gives fine access to file history and diffs.
The feature I'm most jealous of is debugger integration. `gdb` and `dlv` get the job done but it's really convenient to be able step through your code with the same interface you use to write it.
> There is also the point of being able to use vim bindings inside of the IDE
Every vim keybinding re implementation I've tried has been missing essential features. When I'm inside an IDE I spend much of my time typing and navigating. When I'm inside vim I'm _thinking_, and the necessary changes occur about as quickly as I decide upon them.
GNU id-utils provides a mkid command which scans a directory of files to build a binary index file called ID. The lid tool is used to query this and provides a grep-compatible mode.
lid sometimes puts out things in a funny order, so I sort the output.
:set grepprg=lid\ --word\ --result=grep\ '$*'\ \\\|\ sort\ -n\ -t\ :\ -k\ 2
This is basically instant even on huge file trees.Or, if you'd like :grep to use git grep:
:set grepprg=git\ grep\ -n\ '$*'In a large-ish project like the Linux kernel tree, there is no perceptible delay.
I use ctags in parallel with mkid; different tools for different job.
Speaking of :grep, I have it mapped to the K key.
The default action of K is to do a man page lookup of the word under the cursor. I changed it to grep instead. ... and I preserved the man page functionality too. The default K takes an optional prefix (man page section). I have it so that if I give a numeric prefix to K, it will do the man page lookup for that section:
:nmap K "_y:execute count ? ( ":!man " . count . " " . expand("<cword>") ) : ( ":grep \\<" . expand("<cword>") . "\\>")<CR>
and for grepping for a visual selection: :vmap K "zy:execute ":grep " . getreg("z")<CR>IDEA out of the box has:
- fuzzy text search across your entire codebase. Supports regexes, when you need them
- fuzzy text search for symbols only (e.g. when you only need to search for method names etc.). Supports regexes, when you need them
- fuzzy text search for file names
- Ctrl/Cmd + click, or Ctrl/Cmd + B on any symbol, and you'll get a list of all the places where this symbol is used (e.g. a method name that's called from various places in code, including test code)
No extra plugins, or setting up keybindings, needed.
With vim though... Even discussion on search devolves into listing which tools everyone uses, with which options, and a discussion on how circumvent their limitations.
Edit: esp. with search almost every year there's a new tool that you absolutely must use because it's better than the previous tool. ripgrep, ag, telescope, treesitter, semgrep, use them all!
> Edit: esp. with search almost every year there's a new tool that you absolutely must use because it's better than the previous tool. ripgrep, ag, telescope, treesitter, semgrep, use them all!
Aren't you also doing this? "Use IDEA, it's great for searching!".
I think there's something to be said for aesthetics here, where if you like typing you're gonna be into the grep/ripgrep/find aesthetic, and if you like GUIs you're gonna be into IDEs. People trying to assert some kind of objective superiority of their tools over others' is kind of tedious. Use what you want.
I use an IntelliJ plugin that notifies me when I could’ve used a shortcut but I clicked with the mouse instead. It also counts the times I missed a shortcut. I keep a pretty low count but I was watching a colleague that had the same plugin and he had missed a certain shortcut 22k times. He is as productive as I am, so to each his own
I'm simply faster in it. I'd probably say the initial main attractor was modal editing (vim-mode plugins in Jetbrains are not my favorite - usually not a full implementation of the real features vim offers).
* For syntax highlighting: tree-sitter is as good, if not better in my experience.
* For auto-complete/navigation/etc: LSP support + a small few plugins solve this, running on par with what GoLand offers.
* Search support, like the case you mentioned - I use Telescope + Ripgrep and usually my searches are roughly the same time to process as GoLand did.
Are there other features that are drastically important? Because the other features Neovim offers over GoLand are:
* It's way faster to load. Indexing in GoLand takes so long. LSP servers do usually take a bit of time to index but this is on the order of minutes faster than GoLand takes for the projects I have to use at work.
* Significantly less memory consumption.
* I can be purely keyboard driven.
* Modal editing and all the niceties that come with that (note: emulators are always subpar in my experience).
* Being already in the terminal is a significant advantage, especially on my laptop screen (less-so on my ultrawide).
* Customizability is a lower priority, but it is still worth mentioning - there's only so much you can do to customize a Jetbrains editor.
I am far more productive using it than I ever was with GoLand. I might make the exception for IntelliJ when I used to do Kotlin work - but that's the exception, not the rule. For every other language I definitely prefer Neovim.
I think, like all tools, it's important to spend the time to learn it (if you desire to actually use it). Otherwise, of course vim will just look like some archaic tool that seems like it lacks all modern support.
# queries/python/injections.scm
; inherits: python
((call
function: (identifier) @_func
arguments: (argument_list (string) @sql))
(#eq? @_func "text"))
There's a little nuance here where the thing that treesitter parses includes the """ (or ") at the start / end but because it can recovery from errors I'm not bothering with wrangling the offsets.I think it is totally possible to be (even very) productive in VIM. I do think, though, that a person who is productive in VIM would be more productive if he used a proper IDE.
This is my experience after I had been using VIM for about 10 years and switched to an IntelliJ IDE (and actually learned it)
(This, of course, assumes that there is a proper IDE for your language)
What features does a "proper IDE" offer that, at least Neovim, does not or cannot provide?
Class hierarchy visualization, database schema mappings, the latest & greatest in NLP & code completion via plugins. That "just works."
Ultimately, a sufficient amount of configuration adds all those things to Vim/Emacs. Ditto VS Code on a smaller scale.
The issue is how much time.
I use all the obscure features of IDEs. Navigate to next issue, bookmarks, you name it, I've got it, for large codes.
Implementing... all... of the features Intellij/Rider provides out of the box for JVM/React stack in Vim is... an undertaking.
Don't get me wrong. I love SpaceVim, and if I worked in a domain like firmware, I'd be far more comfortable with it.
Maintaining a Vim config that's integrates every tool I need for JVM and React (and machine learning, and all the other domains) is impossible.
In terms of searching through multiple files, I use Telescope with ripgrep and fzf. It’s an insanely slick workflow that allows me to jump around code faster than anything else I’ve used in my last 25 years of coding.
The icing on the cake is when I need to SSH into a server to debug some PHP or JS on a testing server. I know I can always open Vim for a slightly degraded (compared to my Neovim setup) but overall solid editor at any time.
I've not used it but your use case made me wonder if there's a nice way to do it, as I regularly SSH into my NAS and RPi's, so I had a quick search.
I was coding for years before I discovered that IDEs exist. Never used one much until I started using VS Code a few years ago (if you call that an IDE, some people do and some don't).
Reasons for me:
- It's a lot more laptop-friendly not having to deal with a mouse and complex GUI. I even gave up my desk at work and just sit and code in random places.
- On my desk at home, it's a bit faster for me than an IDE. But that depends.
- Seems like IDE users are constantly switching tools, especially when changing jobs. Even at my current 4-year job, my teammates have all changed between 3 different IDEs and had to screw around with remote access problems for each. I've used Vim everywhere since college.
I'm sure I'm missing out on quality of life enhancements and whatnot, but really all of those are lower on my hierarchy of needs than staying on task.
Sure IDE's are great, I love stepping through code, it really helps when you're in deep and are having problems reasoning about the state of your program.
That said, every shop I've worked in used a different IDE. Possibly one picked out by some long gone coder who thought that their choice was the best.
Finally not being saddled to any one IDE lets me use the any other tool to get a job done.
I've tried several times Vim and I just don't get it how you can live without certain functionalities, I'm sure that with enough tinkering you can get pretty close but, for example, search seems to always be kind of a pain in the ass for the complex queries with regex through many files and stuff like that, specially the presenting of results has never been close in my opinion as to something like IntelliJ does it.
Things like "god damn, I've done goofed or I don't quite remember something" and having the internal file history with a diff readily available.
Some of the click and find implementation/usages never seems to quite there to me.
I could go on, if you're truly being productive and not missing out on feature, more power to you, but I honestly wonder if there's no element of fun/pride in using something like vim now-a-days, which of course is totally fine and way more important in my book (to an extent) to pure productivity.
There is also the point of being able to use vim bindings inside of the IDE.
Maybe I'm just an idiot that can't Vim, totally open to that idea, but I'm truly wondering how productive it actually is.