Show HN:我用 4 年写了一整本 Vim 手册
Show HN: I wrote an entire Vim manual over 4 years

原始链接: http://themouseless.dev/vim/

本书通过逐步章节、练习和实用真实示例,在类 Unix shell 中教授 Vim/Neovim,旨在完整、简洁且引人入胜。它面向希望超越基础并投入时间以获得长期效率的用户,而不专注于 GUI、详尽内部机制、IDE 复制或插件。它认为 Vim 值得学习,因为它免费、稳定、快速、可定制、键盘驱动,并能提供类似 IDE 的功能、shell 集成和高效编辑;许多工具和 shell 也共享 Vim 键位,且 Vim 常可在远程服务器上使用。尽管 Vim 以学习曲线陡峭著称,但基础可在数小时内学会,掌握程度会逐步增长。本书由人类而非 AI 编写。

Hacker News 帖子宣布“Learning to Play Vim”,这是一本手工编写的 Vim 手册,历时 4 年以上完成,包含 21 章、170 个练习、示例以及兼容 Vim/Neovim 的配置。作者强调逐步学习,并在不使用 LLM 的情况下理解代码。评论包括一位使用 Vim 20 年、并使用 Copilot 编写自定义函数的用户的称赞;作者更偏好不依赖 LLM。另一位评论者对现代互联网中的真实性表示怀疑;作者回应称其重视所有权、本地纯文本和终端工作流。额外讨论涵盖动机、无鼠标工作的梦想与 GUI 工具、以及 Vim 在大文件或长文件上可能因语法高亮而冻结的问题。整体上,该讨论串围绕一个新的 Vim 学习资源,以及社区对 Vim 自定义和局限的体验展开。
相关文章

原文

There are many resources about Vim out there: what's different with this one?

  • Each chapter builds on the previous one, to show you more advanced techniques as you progress.
  • Practice makes perfect: each chapter comes with exercises to increase your skills, but also to dive deeper and uncover useful subtleties.
  • The book tries to focus on real-life, practical examples, inspired from my own (and friend's) use of Vim.
  • The book is aimed to be as complete as possible, without going into useless, boring details.
  • Even if you use Vim for a long time, I'm pretty sure you'll learn something in this book. If not, ask for a refund!
  • There's a rich annexe section, to serve as a reference when you're working with Vim.
  • The book is designed to be fun to read (we're here to play!) with a minimum of fluff. I don't want to tell the story of my grandma for 392 pages.

What this book is NOT good for?

This book is not for you if:

  • You're not ready to invest some time on the short term to be more effective on the long term.
  • You want absolutely all details about everything. Vim's internal help will do a better job than this book (or any other).
  • You want to learn the basics, but you're not interested to go further. In that case, most free tutorials out there will be enough.
  • You want to reproduce all the functionalities of your IDE without compromises. Vim is powerful (and can do much more than most people think), but it's not your IDE.
  • You're more interested in plugins than Vim's internal functionalities. Learning to Play Vim is more about the latter.

Why should I use Vim?

  • Vim is a free, mature, and stable editor. It has many useful functionalities you won't find anywhere else.
  • Vim is lighter and faster than most IDEs. It's not a problem to have multiple instances running in parallel, even on old computers.
  • You can customize Vim according to your own needs, to focus on your code (or your writing).
  • Vim is fun to play with! To me, it's like a game. The goal: to use as less keystrokes as possible.
  • You can configure IDE-like features (autocompletion, jump to definition, debugging...) for many programming languages.
    No need to have multiple editors or IDEs anymore!
  • Vim allows you to write and edit using only the keyboard, improving your efficiency.
  • Switching between the keyboard and the mouse costs cognitive energy, and breaks your flow. No need to use the mouse with Vim.
  • There are countless plugins for Vim out there, enabling a more modern experience, similar to an IDE.
  • You can use any shell command directly in Vim, expanding drastically its functionalities.
  • Many command-line tools use some Vim keystrokes. It makes them easier to learn.
  • Popular shells (like Bash or Zsh) have a "Vi" mode, allowing you to use some Vim keystrokes to edit your commands.
  • Vim is sometimes the only option for editing files on remote server or docker containers.

Is it true that Vim has a steep learning curve?

Despite its reputation, Vim is not hard to learn. It works differently than most editor or IDE out there, that's why many people find it difficult. If you accept that it requires some adaptation, you can learn the basics in a couple of hours.

Vim is a good example of a tool easy to learn but hard to master: you'll add new functionalities to your workflow overtime, improving your editing experience and your efficiency.

That's why this book takes a step-by-step approach.

Is this book about Vim, Neovim, or GVim?

This book is exclusively about Vim and Neovim running in a *nix shell (Unix-like shell like Zsh or Bash). This book is not about Vim running in a GUI, like GVim for example.

Do you use LLMs ("AI") to write this book?

No.

联系我们 contact @ memedata.com