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

甚至连方向键都没有。


当前回答

我使用vi和vim也有20年了,我还在学习新的东西。

David Rayner的Best of Vim Tips网站是一个很好的列表,不过如果您对Vim比较熟悉,它可能会更有用。

我还想提一下ViEmu网站,那里有一些关于vi/vim技巧的很棒的信息,特别是文章Why, oh, Why, do those nuhead with vi?(存档版本)

其他回答

这绝对是值得努力的。

使用Vi(m)的人会告诉您一个明显的原因,还有两个原因人们似乎从来没有提到过。

这是一个显而易见的例子:

Vi无处不在,功能强大得令人难以置信,通过学习一次,您就可以在几乎任何有键盘的计算机上使用这种功能。

下面是学习Vim的一些鲜为人知的原因:

It's not half as much effort as you think it's going to be. Run through the Vim tutor once (vimtutor at a shell, or in Windows run it from the Vim folder in the Start Menu), and you'll already be well on your way to competence, and it's all downhill from there. I was up to the level where I could use Vim at work without taking any noticeable productivity hit within less than a week's worth of lunchtimes. It's fun! Editing text is like a game to me now. I actively enjoy it--which is pretty ridiculous, when you think about it.

还有两个不学习Vim的好理由:

它会让人上瘾,你会发现自己希望在所有的计算中都能使用Vim命令,而每当不能使用时就会诅咒。幸运的是,至少在某些情况下,有一些方法可以绕过这个问题。 同样,它会让人上瘾,尽管您不会因为实际使用Vim而失去任何生产力,但您将浪费数小时搜索使您的Vim体验更好的好提示,并阅读Stack Overflow上的Vim标签。

这取决于您想用VIM做什么。仅仅因为许多人离不开它而学习它是没有意义的。

当我经常在UNIX环境中工作时,我不能没有它。即使VIM没有安装在UNIX机器上,我也至少可以使用vi。您总是可以依赖它——即使这台机器不是您的(来自客户的)。

现在我用c#编程,主要在windows环境下工作。我在我的电脑上安装了VIM…我不需要它

评估您是否真的需要VIM,以及它是否支持您的“工作流程”。试试吧。玩它。如果你认为你需要它,就坚持下去……学习曲线非常陡峭。

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.

我现在几乎只使用VIM。

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

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

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

我最近改用了VIM,我认为这是值得的。如果你需要“完成一些事情”,你可以一直保持在插入模式,在这种模式下vim就像一个普通的文本编辑器。

我已经注意到,一些以前并不困扰我的事情,比如按方向键,现在感觉不对,太费劲了。它确实减少了我的手部活动和鼠标的使用,这对人体工程学和工作效率都有好处