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(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标签。

其他回答

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

它有用吗?是的。

学习的理由

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

你不需要成为大师。

只是学习

基础知识:

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

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

Vim绝对值得学习,以下是部分总结前面所述的主要原因:

Vi/Vim can be found on most unix systems. Vim allows you to easily code without taking your hands off the keyboard. If you plan you configure anything in a unix based system likelihood is you going to be editing a fair few config files, therefore you'll want to learn a terminal based editor, of which vim is one of the best (sorry emacs). Vim compiles/has precompiled binaries for almost every OS out there. No need to post "I need a textmate alternative for [insert OS]", you'll have Vim instead! There are a lot of good plugins out there to add alot of functionality, such as in-editor cvs diffs, although some of these require a fair amount of tinkering.

另外,如果您喜欢Vim键绑定,也有一些ide在它们的编辑器中包含了Vim绑定,用于简单的命令,例如Komodo Edit。

要获得学习Vim的帮助,请尝试在终端中输入'vimtutor'并按照说明进行操作。还有一本书是特别好的Hacking Vim

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

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

就我个人而言,

我发现许多终端文本编辑器有时无能为力。我会花时间买一个吗?绝对的!我将继续学习一个IDE。当然,最终还是要看个人喜好。

您可能希望学习vim,因为您可能对已经使用的编辑器不满意。

你可能想学习vim,因为很多人说它很酷。看看这个问题你有多少答案。

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