我应该从 Vim 切换到 Emacs,如果是的话有什么建议吗?

发布于 2024-07-14 02:15:19 字数 469 浏览 7 评论 0原文

首先,我喜欢 vim。 我使用 vim 已经有几年了,它改变了我对编辑器能力的看法。 我也喜欢模式。

不过我正在考虑切换,原因如下:

我真的很喜欢 Xcode,它有 emacs 绑定。 我使用 Mac OS X,它在所有文本输入字段中都有 emacs 功能。 我讨厌使用鼠标,我认为切换是有意义的。

我也有点厌倦了在终端窗口中完成所有工作:使用 Xcode,我可以访问一个很棒的 IDE,以及一个很棒的无鼠编辑器 (emacs)。

说了这么多,我发现 emacs 元键方法有点不舒服,而且有点令人畏惧,而且我花了很多时间学习在 vim 中做事。

我应该换吗? 如果是的话,是否还有其他人进行过此转换或同时使用 vim 和 emacs,并对他们更喜欢哪一个以及为什么有意见?

另外,对于使用过 Xcode 的 emacs 用户来说,Xcode 中的 emacs 实现有多好? 值得换吗?

First of all, I love vim. I have been using vim for a few years now and it has changed my perceptions of what an editor is capable of. I also love modes.

However I am thinking of switching and here is why:

I really like Xcode and it has emacs bindings. I use Mac OS X and it has emacs functionality in all text input fields. I hate using the mouse, and I think switching would make sense.

I'm also kind of tired of doing all my work in terminal windows: with Xcode I would have access to a great IDE, and a great rat-free editor (emacs).

Having said all this, I find emacs Meta keys approach a little uncomfortable, and a little daunting, plus I have spent a lot of time learning to do things in vim.

Should I switch? And if so has anyone else made this switch or used both vim and emacs and have an opinion about which they prefer and why?

Also for emacs users out there who have used Xcode, how good is the emacs implementation in Xcode? Worth the switch?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

场罚期间 2024-07-21 02:15:19

为什么不能两者都使用? 使用 Emacs 并不意味着您必须停止使用 Vim。

学习和使用两者的好处:

  • 有时,对于某些特定语言,一个编辑器比另一个编辑器更好。 更好的语法突出显示、更好的缩进规则、更好的宏、与外部工具更好的集成等等。 如果您能够在 Vim 和 Emacs 之间进行选择,那么您将始终使用最适合您的工作的编辑器。
  • 有时,一个社区会被一位编辑所吸引。 无论使用哪个,您都可以参与社区。
  • 您可以从一个编辑器中学习巧妙的技巧并将其移植到另一个编辑器中。 这两种编辑器都有一些功能,如果您只使用其中一种,您永远不会想到这些功能。
  • 如果某些计算机只设置了其中之一,您仍然可以有效地使用它。
  • 学习很有趣。
  • 极客信誉。

缺点:

  • 学习需要时间和精力。
  • 碎片化和重复工作(所有你最喜欢的技巧和键盘映射都必须在 Vim 脚本和 elisp 中编写两次)。

我认为优点大于缺点。

我使用 Emacs 编写 Lisp 代码,并且因为我使用 Lisp 进行 Web 开发,所以我也使用 Emacs 编写 CSS 和 Javascript 等。 我将 Vim 用于 Ruby、Python、Perl、PHP、BASH、纯文本以及几乎所有其他内容。 两位编辑都有优点和缺点,但大多数情况下都有优点。

了解您是否更喜欢 Vim 还是 Emacs 的唯一方法是在两者上投入时间,这样您就可以做出明智的决定。 也许您会发现 Emacs 更适合您的思考和工作方式,也可能不适合。 这是一个非常主观的事情,唯一知道的方法就是尝试。

文本编辑器不是宗教,您大脑中的可用磁盘空间对于所有意图和目的都是无限的。 因此,两者都使用并享受。

Why can't you use both? Using Emacs doesn't mean you have to stop using Vim.

Benefits of learning and using both:

  • Sometimes one editor is better than the other for some particular language. Better syntax highlighting, better indentation rules, better macros, better integration with external tools, or whatever. You will always be using the best editor for the job if you're able to choose between Vim and Emacs.
  • Sometimes a community gravitates toward one editor or the other. You can participate in the community no matter which is used.
  • You can learn neat tricks from one editor and port them to the other. Both editors have features that you'd never think of if you stuck to one exclusively.
  • If some computer only has one or the other set up, you can still use it effectively.
  • Learning is fun.
  • Geek cred.

Disadvantages:

  • Learning takes time and effort.
  • Fragmentation and duplication of effort (all of your favorite tricks and keymappings have to be written twice, in Vim script and elisp).

I see the advantages outweighing the disadvantages.

I use Emacs for Lisp code, and because I use Lisp for web development, I also stay in Emacs for CSS and Javascript and such. I use Vim for Ruby, Python, Perl, PHP, BASH, plaintext, and almost everything else. Both editors have strengths and weaknesses, but mostly both have strengths.

The only way to know if you like Vim or Emacs better is to invest time in both, so you can make an informed decision. Maybe you'll find that Emacs fits the way you think and work better, or maybe not. It's such a subjective thing that the only way to know is by trying.

Text editors aren't religions, and the free disk space in your brain is for all intents and purposes unlimited. So use both and enjoy.

微暖i 2024-07-21 02:15:19

不,一旦 vimer 就是永远的 vimer。

No. Once vimer is forever vimer.

脱离于你 2024-07-21 02:15:19

请记住,emacs 有 viper 模式,它允许您继续使用当前的 vi 键绑定。 至于元键的事情,我将大写锁定映射到 ctrl,将右移映射到 alt,并且对此非常满意。

Keep in mind emacs has viper-mode which allows you to continue to use your current vi key bindings. As for the meta-key thing, I mapped my caps-lock to ctrl and my right-shift to alt and have been pretty happy with it.

离鸿 2024-07-21 02:15:19

这可能更容易:Vi 输入管理器插件(在 Xcode 中工作)

This may be easier: Vi Input Manager Plugin (works in Xcode)

安静被遗忘 2024-07-21 02:15:19

Mac OS X 和 Xcode 中对 Emacs 的支持并不多。 主要是敲几个键。

Mac OS X 附带了 Emacs 的终端版本。 适用于 Mac OS X 的一个非常好的 Emacs 是 Aquamacs

There is not much Emacs support in Mac OS X and Xcode. It is mostly a few keystrokes.

Mac OS X comes with a terminal version of Emacs. A very good Emacs for Mac OS X is Aquamacs.

最初的梦 2024-07-21 02:15:19

我切换到 emacs(我偶尔会尝试一次)的唯一原因是因为出色的 elisp 软件包——特别是所有特殊的编辑模式和控制台/调试器模式。

我从未使用过 Xcode,但我从你的问题中假设这些只是 emacs 键绑定。 即,您不能在 Xcode 中使用任何 emacs 包。

所以不行。 我想说不要切换到 emacs。
如果您想使用 Xcode,请学习按键绑定或使用某些 Xcode vi 模式(正如其他人所建议的那样)。

The only reason I would switch to emacs (and I try every once in a while) is for the wonderful elisp packages -- specifically all the special editing modes and console/debugger modes.

I have never used Xcode but I assume from your question that these are emacs key-bindings only. I.e., you can't use any emacs package with Xcode.

So no. I'd say don't switch to emacs.
If you want to use Xcode either learn the key bindings or use some Xcode vi mode (as has been suggested by others).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文