Live data from Hacker News

Vim After 15 Years (2017)

blog.langworth.com

41–50 of 116 posts

Re: Vim After 15 Years (2017)

#41

Earlier quoted context omitted.

I feel pretty much the opposite. IDE's seem incredibly limiting and feature-poor compared to editors like vim and emacs, which can do just about anything. 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 scrip…

Can vim and/or emacs do refactoring? That is a feature that I use daily and couldn’t live without

You’ll find that most of what happens behind the scenes in vscode is available in neovim (and probably vim and emacs). The heavy lifting is done by lsps these days.

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.

Re: Vim After 15 Years (2017)

#42
post #9

It's alway pretty fascinating to me that people can actually be productive without an IDE. 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 presen…

IMO it’s because you’re conflating vim with an IDE. But really it’s unix that’s the IDE. I’ll use vim to literally edit files, and then in an alternative tmux pane either run my tests or ‘entr’ my source or ‘rg’ to search or git —-bless or whatever… Editor + shell + tools is the IDE. And I like that I can swap out tools as necessary.

And should you want to do any of that from vim, you can (and you can customise it exactly how you want).

Re: Vim After 15 Years (2017)

#43
post #13
post #9

It's alway pretty fascinating to me that people can actually be productive without an IDE. 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 presen…

You have to invest time in your vim setup. There’s a whole lot built in that you need to learn, but you also need to customise it to your workflow. 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.

This, 100%. It took me an hour the first time I configured neovim and another hour when everything broke during the v0.8 update but the ability to navigate multiple files without touching my mouse make it worth the effort. I still have to use Visual Studio for {dayjob} but the Vim binding plugin makes it (almost) tolerable.

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.

Re: Vim After 15 Years (2017)

#44
post #29

Author here. Many will be disappointed to know that I've been using VS Code almost exclusively since 2019 (with the Vim plugin of course). I've been meaning to write a follow-up article, but unfortunately writing is low on the priority list. The main reason is that these days, when I _am_ coding, I mostly write TypeScript and React on my local machine (not much SSH these days), and VS Code Just Works™. I tried twice…

Neovim has improved a lot in the last couple of years. When I initially switched to native lsp it was a giant confusing mess. There was a lot of wading through GitHub issues trying to pull enough info together. Eventually my understanding of all of the underlying machinery got to a reasonable place (and as a result I have much better control over how I set everything up), but it was a battle. Things are slicker now though.

Re: Vim After 15 Years (2017)

#45
post #9

It's alway pretty fascinating to me that people can actually be productive without an IDE. 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 presen…

IdeaVim in the jetbrains products is really good I find. You get best of both worlds. I used to customize vim a lot, but I pretty much just use it as is now as a casual editor for editing files, especially for big files. The editor is very snappy and quick to load compared to IDEs, but on a well spec'd computer you aren't really going to notice too much (depending on the IDE)

Re: Vim After 15 Years (2017)

#46

Earlier quoted context omitted.

About :grep, try integrating GNU id-utils with Vim. 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…

What do either of these `grepprg` options win me? Currently my `grepprg` calls `ag` which is plenty fast for me, and it sounds like `lid` is a slightly more general ctags?

lid doesn't tell you where an identifier is defined, but indexes all the places where it occurs. A lid query is instant; it just pulls the info from the ID file without searching any files.

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("") ) : ( ":grep \\") . "\\>")
and for grepping for a visual selection:

  :vmap K "zy:execute ":grep " . getreg("z")

Re: Vim After 15 Years (2017)

#47
post #29

Author here. Many will be disappointed to know that I've been using VS Code almost exclusively since 2019 (with the Vim plugin of course). I've been meaning to write a follow-up article, but unfortunately writing is low on the priority list. The main reason is that these days, when I _am_ coding, I mostly write TypeScript and React on my local machine (not much SSH these days), and VS Code Just Works™. I tried twice…

Interesting, I just switched from vs code BACK to (neo)vim. For me the killer feature of vscode was remote, but imagine my surprise to see that was one of many proprietary things in the platform. And then I discovered mutagen, and that opened up my avenue for thinking about neovim again.

The neovim lsp story with lspzero is as pain free as I can imagine things to be, so that also helps. In this day and age for the languages I use, neovim is a lovely and blazing fast IDE.

Finally, for the way I like to work, the terminal is often the IDE. One thing I couldn't ever get used to was terminal inside the editor rather terminal being the primary thing. It's why my many attempts at Emacs failed too.

Re: Vim After 15 Years (2017)

#48
post #24
post #15

Earlier quoted context omitted.

Neovim user, so a little different. I used to regularly use GoLand for ~3 years before I made the full switch over, and am a bit of an evangelist of it. 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 b…

Treesitter is amazing. We have a bunch of sql strings in python and I was able to drop a couple of lines into my injections.scm to isolate them and get perfect sql highlighting within my python code.

I didn't even know you could do that, this is why I come to this site.

Re: Vim After 15 Years (2017)

#49
post #29

Author here. Many will be disappointed to know that I've been using VS Code almost exclusively since 2019 (with the Vim plugin of course). I've been meaning to write a follow-up article, but unfortunately writing is low on the priority list. The main reason is that these days, when I _am_ coding, I mostly write TypeScript and React on my local machine (not much SSH these days), and VS Code Just Works™. I tried twice…

Interesting, I just switched from vs code BACK to (neo)vim. For me the killer feature of vscode was remote, but imagine my surprise to see that was one of many proprietary things in the platform. And then I discovered mutagen, and that opened up my avenue for thinking about neovim again. The neovim lsp story with lspzero is as pain free as I can imagine things to be, so that also helps. In this day and age for the la…

I get that. I used to get pretty far with tmux and using Vim to send commands to other tmux panes. But now with web-based tools, live reloading, and utils that watch the filesystem to re-run things, the terminal-inside-an-IDE approach seems fine because I don't need to switch to it as often.

Re: Vim After 15 Years (2017)

#50
post #9

It's alway pretty fascinating to me that people can actually be productive without an IDE. 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 presen…

> It's alway pretty fascinating to me that people can actually be productive without an IDE.

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

Post reply on HN