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是因为我必须学。

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

这真的很痛苦,但值得。

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

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

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

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

:)

其他回答

没有它我能活下去吗?很容易。

它有用吗?是的。

学习的理由

vi保证在所有Unix系统上存在,并且在大多数Linux系统上也存在。这种广泛的覆盖面让学习变得值得。 使用vi编辑sudo要快得多: $ sudo vi 此外,GMail使用vi-ish命令来选择和移动电子邮件!

你不需要成为大师。

只是学习

基础知识:

如何从命令模式切换到插入模式i 如何从插入模式切换到命令模式Esc 如何在命令模式k中浏览一行 如何在命令模式下导航一行j 如何导航左字符在命令模式h 如何正确导航字符l 如何保存文件:wEnter (write) 不保存退出(命令模式下):q!输入 如何撤销 如何重做Ctrl+r 您可以结合写入和退出(在命令模式下)::wqEnter

剩下的只会让你跑得更快。

vi/vim的两个优点:

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

浏览vimtutor只花了我30分钟,这足以让我熟悉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,因为很多人说它很酷。看看这个问题你有多少答案。

我将提供学习vim的另一个原因。它以其文件的质量和完整性而闻名。因此,只要你设法在帮助查询中插入适当的关键字,你就会在帮助系统中找到大多数问题的答案。