离开 Neovim 前往 Zed
Leaving Neovim for Zed

原始链接: https://stevedylan.dev/posts/leaving-neovim-for-zed/

作者的文本编辑器之旅始于 Atom,但在速度较慢的计算机上遇到 Visual Studio Code (VSCode) 的性能问题后,由于 Vim 的速度和功能,他转向了 Vim。 他发现了 Neovim(Vim 的一个分支),并投入了很多年,花费了无数的时间来配置它。 然而,Neovim 与大型代码库作斗争并导致频繁的挂起,导致他考虑替代方案。 最终,他发现了 Zed,这是一种替代文本编辑器,因其速度和易用性而受到称赞。 他发现 Zed 提供了无缝的用户体验,特别是在语言服务器协议 (LSP)、补全和 git 集成方面 - 所有这些都可以完美地开箱即用。 此外,Zed 为习惯 Vim 界面的用户提供了可定制的 Vim 模式。 尽管 Zed 由于缺乏终端兼容性而无法完全取代 Neovim,但作者发现它适合扩展开发会话,并且更喜欢用它来完成日常任务。 总之,作者推荐 Zed 来提高工作效率,称赞其与 Neovim 相比功能流畅且易于使用。

文本编辑器的效率与程序员编写和编辑代码的速度有关。 速度不一定与生产力直接相关,研究表明开发人员平均每天编写大约 10 行完整的代码。 尽管如此,由于响应能力和易用性等因素,文本编辑器的选择仍然很重要。 快速打字技能,例如盲打、学习快捷方式和熟悉文本编辑器界面,有助于在编码过程中集中注意力和流畅。 文本编辑器的缓慢响应或口吃会中断编码流程,对生产力产生负面影响。 编码生产力可能不仅仅涉及实际的代码生成,还包括通信、设计、文档、测试、调试等任务。 尽管一些开发人员可能在一天内编写大量代码,但“完成”代码的概念是指不经常修改的代码部分,代表总编码工作的一部分。 由微小障碍引起的挫败感可能会累积,影响生产力、情绪状态,并最终影响整体工作满意度。 开发人员更喜欢需要最少脑力劳动的编辑器,使他们能够专注于编程挑战,而不是浏览他们所选择的工具的复杂性。 要求过度关注细节或需要持续升级(尤其是扩展和插件)的编辑人员可能会导致分心并扰乱工作流程,从而可能降低工作效率。 作者同意软件开发的很大一部分发生在头脑中,但认为文本编辑器是外部化思维过程并将想法转化为工作代码的重要工具。 开发人员与其文本编辑器之间流畅、高效的交互可减少轻微干扰并实现不间断的思维流,从而提高工作效率。 虽然有不同的方法来捕捉想法——纸张、专用软件或手写笔记等——但文本编辑器有助于在软件开发的创意和决策阶段促进快速迭代和调整。
相关文章

原文
cover-image

I think every developer has their own text editor journey and how they landed on the tool they use today. Perhaps I’m a geek but I love those stories. I have a great appreciation for developer tools and the work that goes into them. This post is for the other geeks out there that also care, and I hope my journey and perspective can prompt others to experiment and try developer tools outside their comfort zones. You never know what you might land on and how much you might enjoy it!

My text editor journey starts with a faint memory of Atom. I was learning the true fundamentals of HTML CSS and Javascript, and I honestly can’t tell you how I landed on Atom as a text editor. I do remember using it for a few weeks, and I kept seeing other people use or mention VSCode, so of course I gave it a shot and used it for a while. However this didn’t last long. At the time my wife needed my laptop for her photo editing job, so I used my brother’s old Macbook that was holding on for dear life. VSCode’s Electron build started taking a noticeable toll on performance, and by chance I also discovered Vim around the same time.

Immediately I was mesmerized by the speed and powers demonstrated by The Primeagen’s early videos. I was already a keyboard maximalist from previous jobs where I learned speed = productivity, so it was a no brainer that I had to learn it. Started with the basic motions and Vim tutor, and I had the advantage that I was just learning programming on the side instead of doing it full time. Within a few weeks I was in Vim consistently, writing and learning to code. The tweaking of my Vim RC eventually led to discovering Neovim thanks to chris@machine and his early videos.

For the next several years I stuck with Neovim and I loved it, and I owe a mass amount of my productivity to it. There were countless hours spent configuring it like many of us do. I eventually got to a point where I didn’t adjust my config much, but that soon didn’t matter.

What Changed

Every now and then I would update a plugin in Neovim and everything would break, and I would have to spend time fixing it instead of getting work done. This resulted in slimming down my config more and more, but there was still so much that went into making all the basics work. I stuck with it because it was still better than using VSCode, which I did try for a two week sprint to see if it could be any better. It was also key to a terminal based workflow that other editors couldn’t really match.

The sentiment started to shift again not too long ago as I started working in some really large code bases, and boy Neovim was struggling. I would have random hang ups, frozen screens, stuff that just drove me nuts when productivity was king. I tried switching to other terminal emulators too such as Alacritty and Wezterm but it didn’t help much.

This is when Zed came back into my sights. I heard about it months before and even gave it a shot back then, but didn’t stick with it because it wasn’t a terminal workflow. However it boasted as being fast, and I decided it was worth another shot. Two months later and I’ve been daily driving it since. I wasn’t sure if it would really hold up, but I can say now it has been an amazing experience and I don’t see myself going back.

My Experience with Zed

In order to understand why I eventually settled on Zed we’ll look at my general experience with it so far and how I made it work for me.

It Just Works

One of the biggest things that has stood out to me using Zed so far is how “everything just works.” There are so many features of an IDE or text editor that people take for granted until they have to set it up themselves in something lower level like Neovim. LSP (language server protocol) is certainly one of them. If you’re not familiar it’s the hints or errors that show up while you’re writing up your code, giving you deep insights to your repo on a language level. When you setup LSP in Neovim it’s a lot of work, and sometimes it can be a bit harder to figure out why it might be bugging out. However it does give you way more control and the option to do a lot of customization. With Zed LSP just works. There are configurations you can make to edit some things, but as a whole it just zips out of the box. There are already keybindings for things like “show definition”, “go to definition”, or even code actions. The only downside is outside of an extension you can’t use your own LSP that’s installed on your machine, but there’s always a pretty large language support that I haven’t had this issue yet.

image of LSP

Another piece that’s related to LSP is completions. This is when you’re typing some code and get suggestions for auto completions that quickly fill the rest of the code out. LSPs usually have great auto-completion because they’re aware of the patterns used in that language. Just to be clear we’re not talking about Copilot yet, this is just completions for snippets and LSP. Once again with Zed it just works out of the box, unlike Neovim which ends up requiring several plugins to make it work right.

联系我们 contact @ memedata.com