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'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.

其他回答

我开始喜欢上vi,是因为我看到有人非常熟练地使用vi,以极快的速度进行编辑。你真的可以用它快速编码。我喜欢它的另一个原因是,有时我发现在IDE中鼠标移动一段时间后真的很疼我的手,而vi提供了一个很好的改变。正如其他人所提到的,它几乎总是在unix系统上可用,即使在糟糕的连接上也能很好地工作。

我没有看到有人提到的一件事是,了解vi在某些圈子里有“极客信誉”的额外好处。我能想到至少有一些人在看到一个新程序员启动nedit来对文件做一些更改时会暗自发笑。

vi/vim的两个优点:

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

我现在几乎只使用VIM。

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

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

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

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

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

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

阅读帮助

我学过Vim。这并不费劲。现在我绝对喜欢ci”ci(cw V:s/from/to/g