As a programmer I spend a lot of hours at the keyboard and I've been doing it for the last 12 years, more or less. If there's something I've never gotten used to during all this time, it's these annoying and almost unconscious constant micro-interruptions I experience while coding, due to some of the most common code editing tasks. Things like a simple copy & paste from a different line (or even the same line), or moving 1 or 2 lines up or down from the current position require too much typing or involve the use of the arrow keys ...and it gets worse when I want to move further - I end up using the mouse. Now imagine this same scenario but on a laptop.

我一直在考虑学习VIM,但掌握它所需的时间总是让我想后退一步。

我想听听那些学会了它的人的意见,如果它最终成为你生活中不可或缺的东西之一。

在工作中,我使用VS2008, c#和r#,它们一起使编辑代码比以前更快更容易,但即使如此,我认为我可以享受根本不需要使用鼠标。

甚至连方向键都没有。


当前回答

I too put off learning vi or vim for many years. Matter of fact, I use to make fun of the "vi guys" who always seemed to be doing finger aerobics. Then, as I moved away from Windows and over to Linux as my primary OS, I had to become more familiar with vim. It was a learning curve and it still is. After 9 years of using vim on a daily basis I still find myself learning new and faster ways of doing things. What I use to think of as "finger aerobics" actually turned out to be an extremely efficient way of being productive. I can now do a whole lot more code development in a whole lot less time and effort than I ever did prior to vim. And as I'm sure you know vim runs on about every platform out there so you always have it when you need it. Also, if you like GUI's they have GUI versions for most platforms. Personally, just like the mouse, I don't want to see a menu bar, scroll bars, etc. cluttering up my editing window(s).

如果你决定尝试一下vim,我强烈推荐O'Reilly的《vi Editor Pocket Reference》一书。它很便宜,如果你只是学习vi (vim),它是很棒的。完整的vim书籍也很好,但口袋参考给你所有的基础知识,快速高效。

其他回答

首先,良好的vi(m)知识将节省您在被围困的服务器上紧急编辑配置文件的时间。它可以支持延迟的ssh连接。

管理的东西除了vim的输入法将是你最好的防御腕管,如果你有效地使用它与人体工程学键盘。

要了解vim的意义,最好的方法是在家里开始一个休闲的项目,拔掉鼠标插头,用胶带遮住方向键。

阅读帮助

vi/vim的两个优点:

它很轻 它几乎安装在每个*NIX系统上

我学vi是因为我必须学。

我那疯狂的老师强迫我们学习用C语言在AIX系统上用终端编程。

这真的很痛苦,但值得。

今天,我只在快速编辑或小程序时使用vi。

当我必须去做一个项目时,我宁愿使用IDE。在我的案例中,IntelliJ idea非常适合这个任务,因为我可以在不抓鼠标的情况下编写数小时的代码。

我不知道VS2008有多少快捷方式,但如果它们像Eclipse一样容易被发现,我认为你有麻烦了,去vi吧。

如果你不在IDE外编辑代码,而你的IDE有很好的快捷方式,你最好学习这些,然后,无论如何,去学习vi。

:)

I'd say vim is definitely worth learning. I picked it up last summer, and it is now my editor of choice for just about everything (java is a stretch, but doable when I don't need extensive analysis support). As everyone has already affirmed, it is a wonderfully efficient tool. For what it's worth, I only learned a fairly small subset of vim's features (which took a day or two) from a graphical tutorial, and a few odds and ends from here (long read), and the search and replace functionality, and I was hooked. I've learned things since then, but at my leisure. I'd say the learning curve flattens out at this point, but then, I was using it pretty heavily and was surrounded by others who were, too.

我对我的textpad和ecplise世界很满意,直到我不得不开始在linux下运行的服务器上工作。需要远程脚本和配置文件的设置!

一开始很难,但现在我可以轻松地设置和调整我的服务器。