Hacker News

Show HN: I wrote an entire Vim manual over 4 years

38 points by thanato0s ago | 12 comments
I'm glad to announce that I'm releasing my new book, Learning to Play Vim.

When I started using Vim more than a decade ago, I wished there was a manual out there teaching how to use this fantastic editor step by step, beginning with the foundations up to more advanced features. Of course at the time I did the vimtutor, but it was too dense for me to remember much from it. I also read the entire Vim manual (`:help manual`), but I didn't like it: it was too detailed in places (for example `02.8 Finding help` completely lost me for a while), and other features didn't get the treatment they deserved.

So I decided to write my own Vim manual. It took me more than 4 years and 2987 focused pomodoros (1244 hours) of work to finally get it done!

The result:

- 21 chapters showing the most important Vim features step by step.

- 170 exercises with solutions.

- Many real-life examples to show how Vim can be used and configured for your own needs.

- The related Vim's help pages to dig further into each feature.

Most configs are both written in Vimscript and Lua for Neovim users. This book explores the common features between Vim and Neovim, so don't expect anything about Neovim-specific features (like treesitter or LSP for example).

- The landing page: https://themouseless.dev/vim/

- A sample of the book with the entire table of contents and the first three chapters covering most of the basics: https://themouseless.dev/content/learning_to_play_vim_sample....

I wrote this with my bare hands, no LLM involved to spoil the fun.

aktenlage |next [-]

Nice work. Luckily I think I don't need it anymore after using vim for 20+ years.

As a motivation for new vim users, I'd like to mention that LLMs make it even more awesome to use such a malleable editor. When I think of some functionality I need, I'll just let Copilot write a small function and key binding and voila, it's done. It's pretty good at vimscript.

Latest example: a key (gK) to show the full git commit message of the current line. Or, when used with a number (e.g. 4gK) the message of the nth previous commit touching that line.

thanato0s |root |parent [-]

I experimented a bit with LLMs and Vim and some are not too bad with Vimscript, but, i don't know, it's more fun without. Also it's nice to understand the code i add in my config.

leowoo91 |next |previous [-]

We are in such era it is hard to believe if author/site/book and comments in this post is legit at all. Maybe it ruined me at least.

thanato0s |root |parent [-]

That's true, that's sad. Since I'm now ancient, I remember an era where there were many forums and weird website full of GIFs. It wasn't perfect for sure, but at least we were owning the Internet, without asking ourselves what's true or false all the time. It's a boolean for god's sake

I guess I'll write about all of that soon, but I think it's important nowadays to own our stuff, without necessarily leaking everything to the data brokers. I like local plain text for that; I just don't depend on anything. It's easy to share too, and format like Markdown can be rendered easily.

Also I like spending my time in the terminal, don't ask me why.

smashandgrab |next |previous [-]

I have this beautiful dream where I never touch my mouse again.

Unfortunately the tools used by incident responders are mostly built in GUIs and tabbing through everything is less productive than just reaching for the mouse.

I don’t hate you, mouse. I just have a dream.

thanato0s |root |parent [-]

What are these tools?

kinfish |next |previous [-]

nice work on this. what was a motivation behind this ? just learning or what

thanato0s |root |parent [-]

Thanks! Vim is quite fascinating, and I don't think using the shell or Vim is that difficult, and it's so flexible! If I've a specific need, say uppercase my titles in some ways, i can just add that and now I've access to a new feature. I don't know, it's just great.

I wrote a lot of stuff in my blog before that, and another book. It's just what I like to spend my morning before work; playing with Markdown, latex, Lua, the shell, and write stuff.

pullshark91 |next |previous [-]

I use only Vim to edit my files everywhere. Today I tried to open a keystore file with vim inside Xarchiver. My XFCE froze and didn't recover from it without reboot. I tried it again and got the same results. Vim is fun.

thanato0s |root |parent [-]

Everything fails. Entropy or something...

Vim always ended up frozen on me when opening big XML files, one big verbose line each. Just had to delete my tmux session though, not restart everything.

alpaca128 |root |parent [-]

Long lines are Vim's biggest weakness, I have no idea why. Even relatively short lines of a couple thousand characters cause noticeable input lag.

thanato0s |root |parent [-]

It could be the syntax highlighting if you have that on; Vim loves to throw regexes to long lines to highlight them. Thankfully it stops at one point. I don't think treesitter using Neovim has this problem, I should test that.

shellwizard |previous [-]

[dead]