Kudos! I've been using vim/IDE vim keybindings for close to 3 decades now, but I've never really taken the time to truly learn it. Despite my years of experience, I don't even know if I'd qualify myself as having intermediate knowledge if I'm being truly honest with myself.
I've been reading the sample and have already picked up a few things I was unaware of. I'll definitely be looking at picking up a copy of the full book.
It's great to see a non-LLM manual like this, well done :)
Personally I use Helix whenever I need a decent terminal-based editor (though most of my coding is done in a JetBrains IDE). I found neovim's plugin ecosystem great in theory but fragile in practice - it seems whenever I install a load of plugins to get it working the way I want it and then come back a while later, half of them have broken. Helix is more limited in its capabilities but feels more stable.
However if there is a stable set of plugins out there (and I see you recommend some in the book) maybe it's worth taking another look.
This is very cool and approachable, thank you. For anyone who suspects use of LLMs - just read some of the book. The language captured my attention in a manner no model is capable of.
It's a very approachable and friendly writing style, indeed. I scrolled through the sample and didn't find anything I didn't already know, but I suspect this will be a very strong book for beginners who want to learn Vim.
Oh that's really cool to read, thank you! I'm not a big fan of LLM writing to be honest, it's so dense and verbose. I'm not saying I'm not dense in my writing myself, but at least I try my best to reduce the verbosity level :D
To me the biggest difference between old grown human writing and LLM: the intent, and the will to try to be accurate. LLM accuracy is often good when it has the data; when it doesn't, it's just a salad of bullshit.
Same for me, I just read the first couple of pages and the intent to be readable and to communicate information effectively is clearly there. I love the writing as well.
LLM texts are often impenetrable text walls that were usually written not to be read but just to exist. And if the prompter doesn't care and doesn't even read it, it's even worse.
That's why I despise LLM-generated documentation, it's horrible to read.
Is it? I often see LLMs generating multiple ideas in one sentence explaining all little details for each. So it's verbose in the sense that there are too many details, and dense because it's a salad of ideas difficult to follow for a human brain. At least mine, which is quite average I believe...
Maybe I use these words wrongly though, wouldn't be the first time :D
I don't think you're wrong to describe it like that, but in general I would say that dense wording = fewer words to convey ideas, and verbose wording = more words to say ideas. There are nuances of those words that make it make sense still, it's just funny to me.
If the physical book has lay-flat binding (can be opened at an arbitrary page and stays open there without any need for cracking the spine, weighing down the pages, etc) I'll gladly buy a physical copy. Does anyone know?
Lay flat makes a huge difference for technical books where you want to experiment as you go, trying the things in the book on your own machine. Sure you can ebook your way there, but it never feels the same, somehow.
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.
Weird. I tried using LLMs for help with vimscript (not even for code generation, just pointed questions) and the results were very broken/hallucinated. My guess is that vimscript is too obscure for LLMs to be useful.
I've recently switched to neovim, and claude is oneshotting plugin tweaks in nvim lua, writes complex keybindings and accurately answers pretty obscure questions, sometimes looking into nvim source code. I doubt it'd have hard time with good old vimscript, though I haven't tried much. It certainly can read and reason about vimscript plugins.
Generating config is not too hard, but as always with LLMs it's also the question of maintainability; I've my dotfiles for a long time now, and I don't have to fix it every two weeks. I'm not sure it would be so pain free if I was just generating config left and right.
Even before LLMs was all what mattered I couldn't really use bloated external config, because without understanding what is what I can't really know what I need and how to add it...
I like simplicity and controlling my tool, that's maybe why.
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.
I understand this is a losing battle, but I wish we could go one thread on HN without making it about LLMs.
The author is sharing something they made, which is new teaching material made by a human (sorely lacking these days), and the top comment is about how someone uses LLMs to do something tangential without learning.
I don’t think there’s a single person on HN who doesn’t know they can use LLMs, no need to keep repeating that at every opportunity.
I understand your sentiment. It can get pretty tiring.
Nevertheless the use of AI is still unfolding and I haven't yet figured out all the applications it has. So every now and then I stumble upon comments like my original one, and discover a new way to use AI.
Indeed I wouldn't wish for it to be the top comment.
I find pomodoros useful yes. I have tendency to lose track of time when I'm focused, so it remind me if I push myself a bit too hard. My life is a succession of extreme motivation, exhaustion, life doubts, and acceptance. Rinse and repeat.
It really depends what you prefer, what tools work for me doesn't necessarily work for everybody.
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.
Yeah, I had the same feeling, not sure about what to say, I wouldn't like being wrong about it and say anything negative about the author in case he is really just trying to help, but there's no time-efficient way to check for these things at this point in time.
Since the efforts of putting vim everywhere are always welcome, I will give some random opinions about it here:
1. The best way of teaching it would probably be a gamified version, not sure if anyone did this yet. People have really low attention spans nowadays. Unless I'm reading a novel or something like that, I will throw text into an LLM to get a summary anyway, even if I feel a bit bad about it (it's just more efficient).
2. Personally I've always referenced people to Luke Smith's (otherwise known as "Vim Diesel") video on vim for beginners to learn most of the useful commands.
No need to throw my text to an LLM, just ask the LLM directly.
I don't think LLMs are the best to generate consistency at the scale of a book. To me it's just a choice between reading human's writing and reading hundred of pages where there is no intention... and maybe full of bullshits. At least my bullshits are due to human error :D
But I mean I don't want this whole thread to be about LLM. It's just about Vim, a cool text editor in the shell.
For the gamified version there is the great https://www.vimgolf.com/, and there is also Vim adventures
Everyone remembers the hjkl keys, even though almost no-one has an ADM-3 keyboard where those keys have arrows engraved on their tops, or even an ADM-3A itself (let alone an ADM-3).
Few in contrast remember that vi from the start had forward space (SPC), backward space (BS), next line (⎈N SO) and previous line (⎈P DLE) for navigation in normal mode.
I hope that your vim book teaches arrow keys first, arrow keys being a thing that we've had in the world of terminals since around 1970, the forwardspace/backspace/next/previous next, and the hjkl last. I think that it really does not serve novices to teach them the way to use vim that matches a 1976 terminal that they do not have, and does not match what the modern keyboard that they do have in front of them has.
Don't make the mistake that Dougherty and O'Reilly made in their 1987 book, of claiming that some terminals might not have arrow keys. Even by 1987, terminals without arrow keys had become a rarity, thanks to the PC revolution and whatnot. 40 years later still, that's an understatement.
I recommend in the book to directly use hjkl and disable the arrow keys... It's how I learned Vim and I'm happy with that. I did everything at the same time: how to type correctly, how to install and drive Arch Linux (btw), how to use a shell-centered workflow. It was really cool to dive deep in all of that, and it was less exhausting than I thought, especially because all these tools can be linked somehow.
I don't know, I just find that staying on the home rows is super comfy. Of course you could map your keyboard differently and put the arrow key closer to the home rows or something, but so many TUI and CLI tools use hjkl I still think it's useful to learn them. And I don't think it's that hard.
> The best way of teaching it would probably be a gamified version
I'd like to offer a counterpoint. I don't think there is any teaching method that works for everyone. I know gamified Vim tutorials is a thing and a few pop up on "show hn" sometimes. but personally, I lose interest whenever I come across a gamified tutorial. Gamified vim tutorials, gamified shell tutorials, gamified coreutils tutorials. None of them work for me. I immediately lose interest.
But give me a well written book (like the one in this 'show hn') and I'm hooked and I'm happy to spend hours and hours on it, digest it, re-read it, go back to it 5 years later, etc. etc.
You can still read the free sample, it's linked in the first message. It's the first three chapters, and the table of contents of the whole book. The internal links don't work well because I can't link to the part of the book missing. It's still 74 pages plus the preface.
Fell in love with Emacs. Sometimes I think of moving back, but the truth is, while you can deeply love two editors at the same time, you need to choose one.
It's almost 5 actually! I realized that when looking at the reddit post to ask folks what they thought about the idea... it was another time it feels like.
I mostly cut Neovim specific stuff. I wanted to speak about LSP and treesitter, but I realized that with Vim native features it was just too much. The book is already quite large when the solutions of the exercises are included, and it would have taken even longer to finish it.
Also these features and Neovim in general are a bit moving targets, so it's difficult to write about it without being inacurate two weeks later.
My biggest regret is to totally skip the Vim's embedded terminal, but I might add that down the line.
No, it's pdf and epub only, no plain text. Although I have no idea what a CLI tool like pdftotext would do... I also had the idea at one point to do one vimtutor-style file per chapter. I might do that in the future. In the todo list
That's true, but then the formatting was made for PDF/HTML/ePub so it wouldn't be as good as plain Vim's help for example (or even Vim's manual, `:help manual`). It would miss all the tags for example to link from one location to the other.
I could publish the source that's true, but it's also a bit my little baby i nourished for the past years, so I'd like it to stay my own. I like working in teams, but I also like to do my little cooking on side.
It's also a way for people to support the work I do on my blog. Granted I didn't update it for a while, but now I'll have more time to get back to it.
Seeing this project really inspired me, in fact, I'm completely gassed up right now. I'm thinking of selling my farts next. 100% human-made, no LLMs involved. Pay what you want (minimum €30). Who's in?
Kudos on finishing the book, that’s a huge achievement!
I’ve been daily driving vim for about 15 years now so don’t think it’s something for me, but it’s good to see new content being created for the next generation software engineers (although they might only see prompt interfaces 99% of the time).
You wouldn't learn that much from the book I agree, but there are always some details and use case we don't necessarily think about. The book is full with examples (including the solutions of the exercises) so it's quite interesting in that sense for power users.
i don't understand the hate i've seen about vim in recent years. it's pretty quick to pick up the basics, and everything else you learn when you need to learn it. at least it's not emacs xD
I don't think it's hate, it's just that Vim is different enough from most text editors for people to get confused quickly, especially if they're coming from the GUI world. And then you get memes.
I mean it's not perfect by any mean but it has so many good ideas. It has some heart I'd say.
In my experience most younger people in the field are here for the payday and not for love of computers. They're significantly less experimental or willing to try new things (paradoxically even when they would drastically improve their output efficiency by doing so.)
I don't know. My blog is mostly about experimenting and learning, and I received many emails from young lads who had some questions and were genuinely interested about how things work under the hood. I wouldn't generalize, although it gets easier and easier not to care about how things work for sure. Still, understanding what we are doing is better to have some feeling of accomplishment I suppose? I mean I don't like to automate away what I like to do :D
I don't exactly hate vim, but I am vocal about it, because it's kicking the can down the road.
For example most developers today haven't even been born when keyboard with arrows drawn on hjkl was discontinued. HJKL is neither intuitive nor ergonomical. Why does it persist as default? Because existing vim people are there for tradition and not good engineering and so are afraid of experimenting and trying new things?
I agree that hjkl is not the most intuitive, it took me a while to use that instead of the arrow keys. That being said, on a "standard" keyboard, the arrow keys are always further away from the home rows, and so it's annoying to always move your hands. So I disagree that it's not ergonomic.
Of course if you can configure your keyboard as you wish it's a different question; you might move the arrow keys around the home rows if you want. But then the deeper you go into Vim the less you use hjkl anyway...
The choice is not binary between hjkl and arrow keys.
It could be (non-exhaustive list):
jkl; - actual resting home row position
ijkl - no hand movement, no pinky usage (also mirrors arrows and controls that are structured that way outside of your keyboard)
asdf - right hand resting home row position
esdf - right hand, no hand movement, no pinky (gamers used to wasd would love it)
Having navigation single key shift away from resting position has no upsides that I can see. It takes premium home row space, except it fits only 3/4. So you either shift your hand all the time, or your index finger is now busy with both right and down and is moving laterally.
And if it's not actually important, why is it on home row and not say bottom row: m,./ - you'd just curl your fingers and access movement without shifting of your hand.
So the explanation today is nothing other than "Our ancestors did it this way and so shall you, youngster. Scientific basis is overrated and we are not trying new things.".
You do realize that the vim keybinding is inherited from vi? And that vi is decades all and had its keybinding replicated across a lot of software. Also some of the keybindings comes from ed and ex commands. So most of your suggestions conflict with those
Also jk is quite nice where they at. I read code more than I write it, and if its formatted for 80 columns, I rarely need to go left or right. So using my strongest fingers is quite nice.
Then you embrace search based navigation and wider movements and you find that you rarely used hjkl other than small movements around a small area.
Completely unrelated, but I find this typo interesting.
My suspicion is that you meant to write "old", but phonetically "all" is quite similar, and your fingers just produced the sound in your head. I'm guessing you've been touch-typing for a long time.
Not sure what's happened there. I was writing this on my phone and I do a version of touch typing there with 2 thumbs. Sometimes I start with an idea, type some words, then stop to think more and then restart typing. When rereading (which I don't do often for HN comments) there are always weird typos and grammatical errors.
I'm not a native speaker. I don't do translation in my head, but I have to consciously think about the idea before typing it (other than platitudes like "How are you?" and "You're welcome" which are basically O(1)). My mind dictates and I type. So the interruptions are like time glitches in my typing for another person, but was perfectly reasonable while I was doing it.
That also reminds me when I was at school and my classmates didn't want to do practice exercises with me. I got the habit of only jotting down checkpoints when I solve problems as writing everything would have slowed me down a lot. So random formulas, figures, and numbers keep appearing with no visible links between them.
Yes, obviously I know where it comes from. After all I already mentioned keyboard with arrows on hjkl - that's https://en.wikipedia.org/wiki/ADM-3A
My point was to illustrate that talking younger people not experimenting or improving is a bit hypocritical when coming from vi/vim community which is comparatively speaking a fossil stuck on first draft from 1976 (designed for hardware that no longer exists) that haven't changed anything for the better because they are already used to something.
Frankly I'm pretty sure there are still "younger people" happy to learn stuff, even if it's about a fossil. I wanted to find some dinosaur bones when i was a child so maybe I went for the text editor instead.
You don’t reinvent your fundamentals when they work well enough. But that doesn’t stop someone from experimenting, to find their boundaries and coming up with something new. Vim has been refined from its first iteration to something that’s very powerful. And there’s a lot of plugins that expanded its power, all created via experimentation.
You don’t have to break what’s working to create something better. Disruption is not the only way to innovation.
> You don’t have to break what’s working to create something better.
Which is an argument for non-vim users to not learn vim as that would require breaking the working workflow they have.
Personally I would be interested in evidence-based editor. Where actions are structured and put on keyboard not by vibes, but by thoughtful consideration of actual usage. Wouldn't really increase my productuvity, especially not in new era, but it would be interesting to have if only to "feel like a hacker".
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.
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.
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.
I struggle to imagine how that could slow it down. In the end it shouldn't matter whether you have dozens of lines or one long wrapped line, it's still roughly the same number of tokens to parse/highlight. Though admittedly I haven't yet tried with syntax highlighting turned off to see if that's the issue.
Regexes are line-based most of the time. And so the more characters you have on the line, the more work the engine has to do to parse it. I guess with greedy quantifiers you need to go to the end of the line and then match from there, and I don't think that's free. Multiply that by the crazy amount of regexes Vim native highlighting uses and the engine begins to struggle.
That being said, I didn't look at the code of the engine itself, so I don't know for sure. But I know that disabling the highlighting get rid of these kind of issues most of the time.
I don’t know how the highlight engine is coded, but I do know that it’s regex based. You moslty have to try every regex on every line. And for some lines you have to try it more than once (think tags).
When it doesn’t match, it’s ok. When it does match you jave to create new structures, adjust their priorities. And for the renderer, every scrolling means reissuing the ansi excape code according to some theme.
All of this are probably bound to the number n of characters in a line. And for big n, that means a lot of operations. Emacs also struggle with long lines.
For what it's worth, Vim is nowhere near as bad with long lines as typical GUI text editors in my experience (currently I have access to Xed and... yeah.)
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.
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.
> Of course, this should all be done on a Debian Linux box
I couldn't go any further in this damned article. I personally believe the author didn't do their homework: while the rodent is an obvious affliction we must get rid of, it can also stroll around when properly trained, and can be tolerated. It's not reliable, the thing having swinging moods; it can perforate some carpal tunnel directly in the wrist, but it's also nice to pet.
But this sentence is where the author lost me. We install Arch Linux over here. To quote one of my friend: You think he's the danger? I am the danger. Or something.
That being said: scheme mentioned, so the author has at least some taste.
That looks cool. I wrote a while back how to have a "mouseless" development environment; I use the keyboard at most thing text and window, but not when it's about graphic design for example (gimp, editing photos with darktable...). Basically I drive daily a combination of linux/i3/tmux/shell/vim. Same system for my work and my personal computer, with mostly the same config.
It took me five years to realize Vim was not for me. Maybe this would've made a difference, but it's 21 chapters long. Perhaps something is wrong wrong with the architecture of Vim itself when it takes 21 chapters to explain how to use a text editor.
I’ve been using Vim for over 15 years, but never tried to learn everything.
Learning the basics like getting used to hjkl instead of arrow keys, and knowing how to jump around like to the top or bottom or a relative number of lines, and learning how the verbs work so that you can “delete inner word” diw and “change inner word” ciw, and how to use regex on whole file and on visual selection, and making a block visual selection, and indenting a visual selection, covers a lot of what I do. Also knowing how to record and play short macros is sometimes useful, but I only reach for macros a couple of times a month at most.
I might be less efficient than someone who knows Vim truly inside and out, but I’m pretty happy with what I get out of Vim with what I’ve learned.
I might come back to this book though, to pick up some more knowledge on Vim. But I have some other books to read first, so I’m not going to buy it today or in the next few months.
That makes sense, I mean Vim's help is really helpful to learn step by step just by doing. Everything you're listing here is already a lot, but for somebody who uses Vim for 15 years that's normal to learn all of that by simply doing. It's a bit learning without the will to learn, isn't it?
Where my book can be useful is due to the cheer amount of real life examples in there, not something Vim's help (or even the official Vim manual) is very good at. I hope it's inspirational and give ideas how to configure things even further.
It’s a powerful editor. The basics can probably be explained inside a single cheatsheet (and that’s what vimtutor does). But that’s just basic editing on the level of any editor.
The rest is learning of the powerful features that exists in vim like registers, macros, the quickfix list, options like makeprg and the concept of compilers, using windows and the sessions,… And there’s the scripting capabilities. Those are what people stay in those editors. Once you craft your perfect tooling, everything else is lacking in some way.
I like vimtutor, but it goes more in depth than it should in my opinion. It's not only the basics; I remember going through a long time ago and didn't remember much a couple of days afterward.
I've also this project of writing multiple vimtutors, one per chapter of the book. I think you can do that in Neovim, not sure about Vim.
Speaking of which, I was wondering about the hexagons on your book's cover art, is there an interpretation for it or just a fun design? It got me thinking about keyboard navigation on a hex grid (with alternating half steps or something, like how the cursor can remember that it's past the end of the current line).
I guess you could say the same thing with preferring the original vimtutor than your ebook. Having it on the browser just happens to be the easier way to teach it to first time windows users without having them download it.
It's just a question of feeling to me. Love even :D Vim is nice to use in my system because it can interface easily with the shell, and it's super responsive. Also it's super easy to install so I'm not sure why I need it to use a replica in the browser...
I think a better analogy would be: why my ebook is PDF and ePub only when it could have been readable and writable in Vim. There are answers to that, but it's true that at the end I display Vim doc outside of the tool I'm speaking about.
I've been reading the sample and have already picked up a few things I was unaware of. I'll definitely be looking at picking up a copy of the full book.
Personally I use Helix whenever I need a decent terminal-based editor (though most of my coding is done in a JetBrains IDE). I found neovim's plugin ecosystem great in theory but fragile in practice - it seems whenever I install a load of plugins to get it working the way I want it and then come back a while later, half of them have broken. Helix is more limited in its capabilities but feels more stable.
However if there is a stable set of plugins out there (and I see you recommend some in the book) maybe it's worth taking another look.
To me the biggest difference between old grown human writing and LLM: the intent, and the will to try to be accurate. LLM accuracy is often good when it has the data; when it doesn't, it's just a salad of bullshit.
LLM texts are often impenetrable text walls that were usually written not to be read but just to exist. And if the prompter doesn't care and doesn't even read it, it's even worse.
That's why I despise LLM-generated documentation, it's horrible to read.
I think I know what you mean, but this seems contradictory:P
Maybe I use these words wrongly though, wouldn't be the first time :D
Lay flat makes a huge difference for technical books where you want to experiment as you go, trying the things in the book on your own machine. Sure you can ebook your way there, but it never feels the same, somehow.
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.
Even before LLMs was all what mattered I couldn't really use bloated external config, because without understanding what is what I can't really know what I need and how to add it...
I like simplicity and controlling my tool, that's maybe why.
The author is sharing something they made, which is new teaching material made by a human (sorely lacking these days), and the top comment is about how someone uses LLMs to do something tangential without learning.
I don’t think there’s a single person on HN who doesn’t know they can use LLMs, no need to keep repeating that at every opportunity.
Nevertheless the use of AI is still unfolding and I haven't yet figured out all the applications it has. So every now and then I stumble upon comments like my original one, and discover a new way to use AI.
Indeed I wouldn't wish for it to be the top comment.
Do you actually find that pomodoro method helpful? The idea always seemed a bit suspect to me.
It really depends what you prefer, what tools work for me doesn't necessarily work for everybody.
Are you... me?
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.
Since the efforts of putting vim everywhere are always welcome, I will give some random opinions about it here:
1. The best way of teaching it would probably be a gamified version, not sure if anyone did this yet. People have really low attention spans nowadays. Unless I'm reading a novel or something like that, I will throw text into an LLM to get a summary anyway, even if I feel a bit bad about it (it's just more efficient).
2. Personally I've always referenced people to Luke Smith's (otherwise known as "Vim Diesel") video on vim for beginners to learn most of the useful commands.
I don't think LLMs are the best to generate consistency at the scale of a book. To me it's just a choice between reading human's writing and reading hundred of pages where there is no intention... and maybe full of bullshits. At least my bullshits are due to human error :D
But I mean I don't want this whole thread to be about LLM. It's just about Vim, a cool text editor in the shell.
For the gamified version there is the great https://www.vimgolf.com/, and there is also Vim adventures
EDIT: Also there is the famous snake game where hjkl are the arrow keys: https://themouseless.dev/snake/
funny enough I wanted to develop a game at one point in Clojure to learn Vim, but I never really finished it. Maybe I should do that.
Oh and here's a wayback machine from 2021: https://web.archive.org/web/20211002194931/https://themousel...
Few in contrast remember that vi from the start had forward space (SPC), backward space (BS), next line (⎈N SO) and previous line (⎈P DLE) for navigation in normal mode.
I hope that your vim book teaches arrow keys first, arrow keys being a thing that we've had in the world of terminals since around 1970, the forwardspace/backspace/next/previous next, and the hjkl last. I think that it really does not serve novices to teach them the way to use vim that matches a 1976 terminal that they do not have, and does not match what the modern keyboard that they do have in front of them has.
* https://news.ycombinator.com/item?id=48753333
Don't make the mistake that Dougherty and O'Reilly made in their 1987 book, of claiming that some terminals might not have arrow keys. Even by 1987, terminals without arrow keys had become a rarity, thanks to the PC revolution and whatnot. 40 years later still, that's an understatement.
I don't know, I just find that staying on the home rows is super comfy. Of course you could map your keyboard differently and put the arrow key closer to the home rows or something, but so many TUI and CLI tools use hjkl I still think it's useful to learn them. And I don't think it's that hard.
I'd like to offer a counterpoint. I don't think there is any teaching method that works for everyone. I know gamified Vim tutorials is a thing and a few pop up on "show hn" sometimes. but personally, I lose interest whenever I come across a gamified tutorial. Gamified vim tutorials, gamified shell tutorials, gamified coreutils tutorials. None of them work for me. I immediately lose interest.
But give me a well written book (like the one in this 'show hn') and I'm hooked and I'm happy to spend hours and hours on it, digest it, re-read it, go back to it 5 years later, etc. etc.
Try https://vim-adventures.com/ :-)
I mostly cut Neovim specific stuff. I wanted to speak about LSP and treesitter, but I realized that with Vim native features it was just too much. The book is already quite large when the solutions of the exercises are included, and it would have taken even longer to finish it.
Also these features and Neovim in general are a bit moving targets, so it's difficult to write about it without being inacurate two weeks later.
My biggest regret is to totally skip the Vim's embedded terminal, but I might add that down the line.
but why? surely you didn't write the book directly as a pdf file. Why don't you publish the text source that is already viewable in vim?
I could publish the source that's true, but it's also a bit my little baby i nourished for the past years, so I'd like it to stay my own. I like working in teams, but I also like to do my little cooking on side.
It's also a way for people to support the work I do on my blog. Granted I didn't update it for a while, but now I'll have more time to get back to it.
I’ve been daily driving vim for about 15 years now so don’t think it’s something for me, but it’s good to see new content being created for the next generation software engineers (although they might only see prompt interfaces 99% of the time).
You wouldn't learn that much from the book I agree, but there are always some details and use case we don't necessarily think about. The book is full with examples (including the solutions of the exercises) so it's quite interesting in that sense for power users.
I mean it's not perfect by any mean but it has so many good ideas. It has some heart I'd say.
and yeah Vim is not an OS ;)
For example most developers today haven't even been born when keyboard with arrows drawn on hjkl was discontinued. HJKL is neither intuitive nor ergonomical. Why does it persist as default? Because existing vim people are there for tradition and not good engineering and so are afraid of experimenting and trying new things?
Of course if you can configure your keyboard as you wish it's a different question; you might move the arrow keys around the home rows if you want. But then the deeper you go into Vim the less you use hjkl anyway...
Also, here's a sokoban when you can use arrow keys or hjkl: https://themouseless.dev/sokoban/
It could be (non-exhaustive list):
jkl; - actual resting home row position
ijkl - no hand movement, no pinky usage (also mirrors arrows and controls that are structured that way outside of your keyboard)
asdf - right hand resting home row position
esdf - right hand, no hand movement, no pinky (gamers used to wasd would love it)
Having navigation single key shift away from resting position has no upsides that I can see. It takes premium home row space, except it fits only 3/4. So you either shift your hand all the time, or your index finger is now busy with both right and down and is moving laterally.
And if it's not actually important, why is it on home row and not say bottom row: m,./ - you'd just curl your fingers and access movement without shifting of your hand.
So the explanation today is nothing other than "Our ancestors did it this way and so shall you, youngster. Scientific basis is overrated and we are not trying new things.".
Also jk is quite nice where they at. I read code more than I write it, and if its formatted for 80 columns, I rarely need to go left or right. So using my strongest fingers is quite nice.
Then you embrace search based navigation and wider movements and you find that you rarely used hjkl other than small movements around a small area.
Completely unrelated, but I find this typo interesting.
My suspicion is that you meant to write "old", but phonetically "all" is quite similar, and your fingers just produced the sound in your head. I'm guessing you've been touch-typing for a long time.
It's amazing that the human brain works that way.
Not sure what's happened there. I was writing this on my phone and I do a version of touch typing there with 2 thumbs. Sometimes I start with an idea, type some words, then stop to think more and then restart typing. When rereading (which I don't do often for HN comments) there are always weird typos and grammatical errors.
I'm not a native speaker. I don't do translation in my head, but I have to consciously think about the idea before typing it (other than platitudes like "How are you?" and "You're welcome" which are basically O(1)). My mind dictates and I type. So the interruptions are like time glitches in my typing for another person, but was perfectly reasonable while I was doing it.
That also reminds me when I was at school and my classmates didn't want to do practice exercises with me. I got the habit of only jotting down checkpoints when I solve problems as writing everything would have slowed me down a lot. So random formulas, figures, and numbers keep appearing with no visible links between them.
My point was to illustrate that talking younger people not experimenting or improving is a bit hypocritical when coming from vi/vim community which is comparatively speaking a fossil stuck on first draft from 1976 (designed for hardware that no longer exists) that haven't changed anything for the better because they are already used to something.
I was just raising the point that if vim users refuse to change, it's reasonable to expect people to not change to vim usage.
You don’t have to break what’s working to create something better. Disruption is not the only way to innovation.
Which is an argument for non-vim users to not learn vim as that would require breaking the working workflow they have.
Personally I would be interested in evidence-based editor. Where actions are structured and put on keyboard not by vibes, but by thoughtful consideration of actual usage. Wouldn't really increase my productuvity, especially not in new era, but it would be interesting to have if only to "feel like a hacker".
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.
That being said, I didn't look at the code of the engine itself, so I don't know for sure. But I know that disabling the highlighting get rid of these kind of issues most of the time.
When it doesn’t match, it’s ok. When it does match you jave to create new structures, adjust their priorities. And for the renderer, every scrolling means reissuing the ansi excape code according to some theme.
All of this are probably bound to the number n of characters in a line. And for big n, that means a lot of operations. Emacs also struggle with long lines.
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.
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.
I found the inspiration hilarious, don't miss it even if this window manager is not for you.
https://www.nongnu.org/ratpoison/inspiration.html
I couldn't go any further in this damned article. I personally believe the author didn't do their homework: while the rodent is an obvious affliction we must get rid of, it can also stroll around when properly trained, and can be tolerated. It's not reliable, the thing having swinging moods; it can perforate some carpal tunnel directly in the wrist, but it's also nice to pet.
But this sentence is where the author lost me. We install Arch Linux over here. To quote one of my friend: You think he's the danger? I am the danger. Or something.
That being said: scheme mentioned, so the author has at least some taste.
Learning the basics like getting used to hjkl instead of arrow keys, and knowing how to jump around like to the top or bottom or a relative number of lines, and learning how the verbs work so that you can “delete inner word” diw and “change inner word” ciw, and how to use regex on whole file and on visual selection, and making a block visual selection, and indenting a visual selection, covers a lot of what I do. Also knowing how to record and play short macros is sometimes useful, but I only reach for macros a couple of times a month at most.
I might be less efficient than someone who knows Vim truly inside and out, but I’m pretty happy with what I get out of Vim with what I’ve learned.
I might come back to this book though, to pick up some more knowledge on Vim. But I have some other books to read first, so I’m not going to buy it today or in the next few months.
Where my book can be useful is due to the cheer amount of real life examples in there, not something Vim's help (or even the official Vim manual) is very good at. I hope it's inspirational and give ideas how to configure things even further.
The rest is learning of the powerful features that exists in vim like registers, macros, the quickfix list, options like makeprg and the concept of compilers, using windows and the sessions,… And there’s the scripting capabilities. Those are what people stay in those editors. Once you craft your perfect tooling, everything else is lacking in some way.
I've also this project of writing multiple vimtutors, one per chapter of the book. I think you can do that in Neovim, not sure about Vim.
https://vimgolf.ai
Never been a fan of Vim in the browser, sorry :D I like the real thing in the shell.
I think a better analogy would be: why my ebook is PDF and ePub only when it could have been readable and writable in Vim. There are answers to that, but it's true that at the end I display Vim doc outside of the tool I'm speaking about.