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#,它们一起使编辑代码比以前更快更容易,但即使如此,我认为我可以享受根本不需要使用鼠标。

甚至连方向键都没有。


当前回答

我在远程计算机上维护一个非常大的linux项目。不能选择使用Eclipse或类似的基于GTK的IDE。我在那里工作三年了。 我为这个项目设置了vim。还在调整。

现在我可以在Vim中做任何事情:源代码控制、sql、调试、编译、浏览——非常快速地浏览超过1Gb的源代码。

Visual Studio或Eclipse无法处理所有这些。如果我有选择,我不会把Vim换成其他编辑器或IDE。

其他回答

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

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

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书籍也很好,但口袋参考给你所有的基础知识,快速高效。

是的:如果你不使用,也不打算在将来使用任何IDE。即使您使用IDE,您也会发现自己要返回到它来做许多事情。在vim中,你可以编写脚本,执行复杂的任务,比如使用命令(有点晦涩,但一旦上手就很容易理解)而不是单独编辑500行。起初我觉得很难,但后来它帮助了我很多。即使是最好的IDE编辑器也缺乏vim的功能。Vim可以很好地与CVS、SVN、make、调试器等一起工作。

不:如果你坚持使用Eclipse或Netbeans这样的ide。或者你觉得像凯特这样的编辑对你来说就足够了。事实上,Kate或notepad++或jEdit有GUI和你可能在vim中错过的功能。例如,Kate的符号查看器或notepad++的巨大菜单栏。

我现在几乎只使用VIM。

我以前使用Vim进行编辑,使用VS Editor进行调试。这可能看起来有点疯狂,但我发现Vi模式(宏,基于home键的编辑等)对我的工作效率有很大的提高,在VS中编辑是很痛苦的。

多亏了Viemu,我甚至不用再做切换了。它还不是完美的解决方案(代码完成有时不像原生vim中那样优雅,宏记录也不完美),但它比不断地来回切换要好得多。

Vim的学习曲线可能被夸大了。我认为一旦你进入它,它是相当直观的。

恕我直言,学习新东西总是值得努力的。我建议你打印一张小抄单,强迫自己日复一日地使用它。