工具与资源dougblack.io
一份优秀的 vimrc
A Good Vimrc
2015 — 2017,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这是 Doug Black 写的一篇关于如何写好 vimrc 的文章:他逐条列出自己 .vimrc 里的设置,解释每一行为什么这么写,并强调不要把看不懂的配置复制进去。文中涵盖缩进/制表符、搜索、快捷键重映射、插件与外观等常见配置项。
为什么经久不衰:vimrc 高度个人化,但这篇文章示范的是「每一行都懂再放进去」的方法,配合评论里的 vim-sensible、自动检测缩进等建议,今天仍是配置 Vim 的好起点。
HN 评论精选
用 Caps Lock 映射 Esc 比 jk 组合更优雅实用。
把 jk 重映射成 Esc 在我看来挺丑的,尤其是重映射之后不等待就没法正常输入这两个字符。为什么不直接把 Caps Lock 改成 Esc?Caps Lock 位置显眼却用得极少。Linux 下可以在 .profile 里加 `setxkbmap -option caps:escape`,想互换则用 caps:swapescape。这大概是我 Vim 工作流里影响最大的一处改动。
Nyubis查看英文原文
Rebinding jk to escape because escape is too far away seemed like a fairly ugly hack to me, especially because you can't type it anymore without waiting. Why not simply rebind caps lock to escape? Caps lock is used awfully little, considering how prominent its position on the keyboard is. On Linux, you can rebind it by adding setxkbmap -option caps:escape to your .profile. If instead of an additional escape you prefer it to be swapped around, use setxkbmap -option caps:swapescape This is perhaps the most impactful change on my vim workflow.
质疑 Vim 默认配置是否真的不可用,以及配置的碎片化。
我不用 Vim 当主力编辑器,所以可能问得傻:它默认设置就那么糟糕吗?我只遇到过极少数 Vim 用户能直接上手别人的配置还能干活,也从没见过谁用别人的配置不吐槽到处都不一样。所以问题是:人们改 Vim 是因为能改,还是因为不得不改?
hoorayimhelping查看英文原文
I don't use vim as my go to editor so I may be asking a silly question; does it just use idiotic defaults or something? I've only met a couple 'vim users' who could just hop onto someone else's vim setup and be productive, and I've never met a single vim user who could use someone else's setup without making comments about everything being different. I guess the question is do people modify vim cause they can or cause they have to?
推荐 vim-sensible 作为保守的默认配置起点。
对刚入门或偶尔用 Vim 的人,Tim Pope 的 vim-sensible 是个保守可靠起点:它只把 Vim 那些离谱的默认值改成合理的基础配置,不含自定义键位和花哨插件。Vim 默认是为了兼容历史上某个 vi 实现,我觉得这在今天已没意义。
exDM69查看英文原文
For those just getting started or using vim only occasionally, Tim Pope's vim-sensible is a good, conservative starting point. It just sets some reasonable base configs instead of Vim's crazy default settings. No custom keybindings or fancy plugins included. Vim is by default intended to be compatible with some historical implementation of vi. In my opinion, it doesn't make any sense any more, but I guess there is some reasoning behind the decision. https://github.com/tpope/vim-sensible
先掌握 Vim 核心概念,再参考多位高手的配置,而非照抄单一 vimrc。
我认为不真正掌握移动、操作符、寄存器、窗口这些基本概念,就不可能写出好的 vimrc。我最近看完 Drew Neil 的全部 VimCasts,几小时后就意识到自己这十年漏掉了多少东西。Max Cantor 的演讲《How to Do 90% of What Plugins Do (With Just Vim)》也很值得看。与其把某一份 vimrc 当作最佳配置,不如翻翻 Drew Neil、Tim Pope 这些有影响力的用户的 dotfiles 和插件。
wodny查看英文原文
I don't believe it's possible to have a good vimrc without really grasping some elementary concepts like movements, operators, registers, windows etc. I have recently watched all the Drew Neil's VimCasts[1] and after just a couple of hours I've realized I was missing a lot for at least 10 years. There is also quite a good presentation on YouTube by Max Cantor "How to Do 90% of What Plugins Do (With Just Vim)"[2]. Instead of treating a single vimrc as the best one it's useful to skim through dotfiles and plugins of some influential vim users like Drew Neil[3] and Tim Pope[4]. BTW VimCasts are accompanied by a book. The second edition[5] includes changes introduced by Vim 8.0. [1]: http://vimcasts.org/episodes/ [2]: https://www.youtube.com/watch?v=XA2WjJbmmoM [3]: https://github.com/nelstrom/dotfiles [4]: https://github.com/tpope [5]: https://pragprog.com/book/dnvim2/practical-vim-second-edition
历次讨论
同类还值得读
直接在浏览器中启动 Linux 内核
Boot a linux kernel right inside your browser.
Fabrice Bellard 的 JSLinux 页面,用 JavaScript 在浏览器里启动一个 Linux 内核,并提供一个可交互的终端环境。
工具与资源上首页 5 次 · 2011–2025bellard.orgHacker News 未公开功能与行为清单(2018)
A List of Hacker News's Undocumented Features and Behaviors (2018)
数据科学家 Max Woolf 整理的 Hacker News 未公开功能与行为清单,涵盖投票机制、排名算法、账号惩罚等社区运作细节。
工具与资源上首页 5 次 · 2019–2025github.comMapSCII:在终端中用盲文和 ASCII 渲染地图
MapSCII – Braille and ASCII map renderer for the console
MapSCII 是一个在命令行终端里渲染地图的开源工具,用盲文字符和 ASCII 字符把地理数据画成可交互浏览的字符地图。
工具与资源上首页 5 次 · 2017–2025github.com顶尖大学的免费在线课程
Free Online Courses from Top Universities
Open Culture 整理的一份免费在线课程合集,汇集了全球顶尖大学(如 MIT、斯坦福、耶鲁等)向公众开放的网络课程资源,涵盖音频、视频等多种形式。
工具与资源上首页 5 次 · 2010–2022openculture.com淘气字符串:容易引发用户输入问题的字符串清单
Naughty Strings: A list of strings likely to cause issues as user-input data
一个 GitHub 仓库,收录了大量容易让程序出问题的用户输入字符串,如特殊字符、emoji、SQL 注入片段、系统命令等,供开发者用于测试输入处理逻辑。
工具与资源上首页 4 次 · 2015–2020github.com