工具与资源viemu.com
为什么那些疯子要用 vi?
Why, oh why, do those nutheads use vi?
2008 — 2021,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这是一篇为 vi/vim 编辑器辩护的经典文章,解释为什么有人甘愿忍受陡峭的学习曲线和看似反直觉的模式化操作。文章从键盘编辑效率和组合命令的角度论证 vi 的独特优势,但结尾略带说教语气,常引发编辑器之争。
为什么经久不衰:它精准捕捉了编辑器之争的核心——学习成本与长期效率、模式编辑与 IDE 便利——二十多年来仍是理解 vi/vim 文化的经典入口。
HN 评论精选
二十年 vi 用户仍觉得 GUI 编辑器更自然,因为需要滚动条、文件列表、标签页和鼠标操作。
我从未真正对 vi 感到自在。1989 年在家开始用,整个大学期间都用,职业生涯中也断断续续用,但它从未像 GUI 编辑器那样让我觉得强大。我想要滚动条,想要项目文件列表可以点击打开,想要可点击的标签页,想要能用 alt-tab 切换的多个窗口。而且我大部分时间都在思考和修改代码,更多是在做微调和跨文件复制粘贴,而不是“在这个三词块里替换”。即使用了 20 年 vi,鼠标和 GUI 对我来说仍然自然得多。
kstenerud查看英文原文
I've never really felt comfortable in vi. I first started using it in 1989 at home, used it throughout college, and then used it on-and-off during my career, but it's never really felt powerful compared to a GUI editor. I want a scrollbar. I want a list of files in my project that I can just click on to open. I want tabs I can click. I want multiple windows that I can alt-tab to. And since I spend most of my time thinking and modifying code, I'm more often than not thinking in terms of tweaks and copy/pasting between files rather than "replace in this block of 3 words". A mouse and GUI just feels a lot more natural to me, even after 20 years of vi.
IDE 在文件导航、代码搜索、自动补全、调试和重构等方面远胜 vim,现代开发中导航至关重要。
坦白说,我觉得 vim 对我做的项目类型是一种阻碍。我用 IDE 最常见的事情之一是导航(在文件之间),而 vim 在这方面不如 IDE:没有标签页,没有项目结构;在我的 IDE 里,我可以 Ctrl-点击一个类跳转到定义,可以搜索类名,按 Ctrl-T 找谁继承了某个东西,Ctrl-Alt-H 找谁使用了某个东西等等。当我真正写代码时,通常是在多个文件里各写一两行,所以即使编辑时导航也极其重要。此外,自动补全、在 IDE 内调试、代码检查、自动重构、按规范格式化、共享配置、集成版本控制等,都是文本编辑器做不到的。
Illniyar查看英文原文
Frankly I find vim an hindrance to the type of projects I work on. One of the most common things I use an IDE for is navigation (between files) and vim is not very good at it compared to IDEs, here's why: * no tabs * no project structure * in my IDE (eclipse based or intellij based) I can ctrl-click a class/object/other to navigate into that object's definition * in my IDE I can search for classnames, I can press ctrl-T to find who inherits from something, ctrl-alt-H to find who uses something etc... when I find myself actually writing code, it's usually a line or two in each of several files (because modern programming paradigms tell us we should split code as much as possible), or modifying some copy pasted snippet I found on google - so navigation is extremely important even when editing. beyond that, there are simply some things that help writing code that a text editor cannot do: * auto-complete(with annotation to tell you what the function variables are) * debug inside your IDE * run code-lint, auto-build on typing to detect errors, etc... * auto refactor (I.E. extract method, move variable, extract class etc...) * format all your files according to your pre-specified project guideline. * sharing you IDE configuration with other contributors * showing when files are/aren't in version control and integrating version control so that you view history in your IDE. There are probably projects out there where a full-featured text editor is a real game-changer and is worth the days/weeks it'll take to use it intuitively, but I never worked or know anyone who worked on such a project (even when I started projects from scratch);
学习 Vim 是渐进过程,需要每天刻意重复新命令并在实际编程中强制使用,直到形成肌肉记忆。
我基本上是因为它很潮才开始学 Vim。头两年我真的不知道该怎么学,只会进入插入模式、用方向键移动,然后 :wq。六个月后我开始学基本命令,比如用 55gg 跳到第 55 行,G 到最后一行,gg 到第一行。然后学缓冲区,开始打开多个文件,用 minibufexplorer 作为插件入口。又过了六个月,我开始学动作命令,成了大学里的潮人 Vim 用户。编辑 CSV 时我用 Vim 而不是 awk/sed,只是为了多学一点。一年后,我自称基本 vimmer,仅凭搜索、移动、动作、缓冲区、一个自动补全插件和一些杂项插件,就觉得自己在工作场所比别人强。整个过程中我观察到:光读一篇关于 Vim 的酷文章然后放下是不够的。我会每天至少重复文章中提到的操作十次,并在编程中找到它的用途。我会刻意强迫自己使用它,直到某个时刻,刚学会的操作神奇地替代了我正要做的笨拙操作。那时我就知道自己掌握了它。
pinkunicorn查看英文原文
I basically started learning Vim because.. well it was a hipster thing. The first two years, I really did not know how to actually learn it. All I would do is enter insert mode, move around with arrows and ":wq". But then after 6 months, I started with basic commands, like "55gg" to move to the 55th line etc, "G" to the last line and "gg" to the first line. Then came buffers, I started opening multiple files and started using minibufexplorer(my entry point into plugins). This went on for another 6 months. Next came actions and boy oh boy, I became the hipster vim user in college. While editing CSV files(like deleting all instances of a particular row having text "abc"), I used Vim instead of awk/sed just because I wanted to learn more. Fast forward a year, I call myself a basic vimmer and superior to others at my workplace by just knowing search, moving around, actions, buffers, a cool autocomplete plugin and other plugins here and there. Throughout the learning process one thing I observed was that, its just not enough to read about a cool article about Vim and leave it there. I would keep repeating the sequence of actions mentioned in the article atleast ten times every day and would find some usage for it during programming. I would intentionally force myself to use it, until at some point, the action I just learnt magically comes in as a replacement for a dumb action I was about to do. At that point I would know I've mastered it.
批评 vi 文章结尾居高临下,认为 vi 擅长快速编辑而 IDE 擅长快速维护,理想是 IDE 内置好的 Vim 键绑定。
> 你想怎样就怎样。如果你觉得不值得花力气,就别学。去学 Emacs。或者留在 IDE 里用烂编辑器。随便。 为什么所有关于 vi 有多棒的文章都以居高临下结尾?总之:vi 擅长快速编辑,IDE 擅长快速维护。我知道我会选哪个。人们选择 IDE 不是因为文本编辑功能(当然,在支持良好的静态类型语言中这最有帮助)。而且完全可以有支持良好 Vim 键绑定的好 IDE,这将是两个世界的绝妙结合,最终结束这场愚蠢的讨论。我相信至少 Qt Creator 内置了半像样的 FakeVim 模式。
skrebbel查看英文原文
> Do whatever you want. Don't learn it if you feel it's too much effort just for nothing. Learn emacs instead. Or stay in your IDE using a lousy editor. Whatever. Why do all articles about how wonderful vi is end with condescension? Anyway: vi -> fast editing. IDE -> fast maintenance. I know which one I'd choose. The text editing features of an IDE is not why people choose to use IDEs (note: of course this helps best if you use a well-supported statically typed language - a Ruby IDE can't be as awesome as a Java IDE). Also, there could perfectly well be good IDEs with good Vim key binding support. This would be a wonderful mix of two worlds, and finally end this stupid discussion. I believe at least Qt Creator has a half-decent FakeVim mode baked in.
历次讨论
同类还值得读
直接在浏览器中启动 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