“I highly recommend taking a look at Learn Vimscript the Hard Way to learn how to do it. Thanks to that guide I was able to write my first simple plugin”
Steve Losh 写的 Vimscript 入门教程,按短章节逐步讲解映射、选项、变量、函数、自动命令,最后带读者写一个完整的插件。风格沿用“笨办法”系列:每章都有要敲进编辑器的例子。内容基于传统 Vimscript,书中也讲了不少 Vim 本身的运作逻辑。和直接翻 Vim 帮助文档相比,它的顺序更适合循序渐进地学。
HN 上的人推荐它,是因为写 Vim 插件时它几乎是最好的入门资料;也有人说读完后对 Vim 的语义理解更深。2026 年有评论提到它有些过时,但对理解传统 Vimscript 仍有帮助。
已经会用 Vim、想自定义配置或写插件的人
怎么读
由 Claude 根据这本书和 HN 上的说法整理,可能有错- 1先会用 Vim 的基本操作,再从映射和选项几章开始读
- 2每章的例子都亲手敲进 Vim 里试一遍
- 3读完前面基础后,跟着书里的插件项目走一遍
- 4只想用 Vim 不写插件,也可以挑讲映射、operator 的章节读
HN 书评
推荐在前,同类按时间 · 每本最多保留 20 条,统计用全部提及 · 作者本人贴的不算“Learn Vim script the hard way [1], even if you didn't end up writing any actual vim script, was a game changer in terms of understanding the semantics.”
“The two things that most helped me learn Vim, beyond the very basics, were Drew Neil's excellent Vimcasts [0] and Steve's own Learn Vimscript the Hard Way [1]”
“Use this to learn vim:”
“And if you use Vim or a Vim-mode in your IDE, remap the sequence 'jk' to Esc. I never leave the home row anymore. See Learn Vimscript the Hard Way”
“if you're ever in the unfortunate position of needing to write or edit a Vim plugin, "Learn Vimscript the Hard Way" is invaluable Learn Vimscript the Hard Way”
看全部 19 条 →
“Better to learn foundational vim concepts, and then make this decision.”
“Steve Losh is also the author of Learn Vimscript the Hard Way, one of the best resources for writing Vim plugins.”
“Not sure if you've seen this, but worth working through, sooner or later (no rush): Learn Vimscript the Hard Way”
“There is also Learn VimScript the Hard Way, which is of course a bit outdated, but it does help to know "legacy" vimscript.”
“I always liked this site to grok some of those vim fundamentals [1]”
“Consider this sample grap extension take from Steve Losh's Learn Vimscript the Hard Way”
“Also, Steve, would you consider using the Creative Commons Attribution-NoDerivs 3.0 license instead of a homemade license?”
“which ties in with Steve's quote in Learn Vimscript the Hard Way, "The idea of operators and movements is one of the most important concepts in Vim”
“Sorry, I guess I didn't describe that in the article. I've updated the article to include this link:”
“:inoremap jk <esc>”
“The difference is that the noremap variant is non-recursive [0].”
“If a vim-only solution is good enough, then this could be accomplished using the "abbreviations" feature: Learn Vimscript the Hard Way”
“Lazyloading is already present in Vim, it’s called autoload and most plugins I’ve seen use that feature”
- Learn Vimscript the Hard Way ↗octopus · 2011-10-07 · 27 分