这是用户在 2024-7-30 16:21 为 https://synthetic.work/splendid-edition/issue-19-how-to-turn-visual-studio-code-into-the-ultimate-wr... 保存的双语快照页面,由 沉浸式翻译 提供双语支持。了解如何保存?

Issue #19 - How to turn Visual Studio Code into the ultimate writing tool for people who don't write a single line of code
问题 #19 - 如何将 Visual Studio Code 转变为不写一行代码的人的终极写作工具

July 2, 2023 2023 年 7 月 2 日
Splendid Edition 华丽版
In This Issue 在此问题中

  • A very long explanation of what extensions, features, and configurations I used to transform a tool for software developers, Visual Studio Code, into the ultimate tool for writing long-form English content pieces like the Synthetic Work newsletter.
    对我用来将一个为软件开发人员设计的工具 Visual Studio Code 转变为撰写长篇英文内容(如 Synthetic Work 时事通讯)的终极工具所使用的扩展、功能和配置进行了非常详细的解释。
Intro 简介

This week, we do something a little bit different, dedicating the entire issue to a single section, The Tools of the Trade, to do something way geekier than usual for Synthetic Work.
本周,我们做一些稍微不同的事情,将整个期刊专门用于一个部分,行业工具,以便为 Synthetic Work 做一些比平常更极客的事情。

We’ll turn an app designed for software developers, Visual Studio Code, into the ultimate writing tool for people that don’t write a single line of code.
我们将把一个为软件开发人员设计的应用程序 Visual Studio Code 转变为不写一行代码的人的终极写作工具。

Whatever is your line of business, especially if you are not a technical person, this issue is for you.
无论您的业务是什么,特别是如果您不是技术人员,这个问题是为您准备的。

But even if you are a technical person and you already use Visual Studio Code every day, you might find interesting information here as I talk about Copilot competitors and test the newest version of Cody by Sourcegraph.
但即使您是技术人员,并且每天都在使用 Visual Studio Code,您也可能会在这里找到有趣的信息,因为我将讨论 Copilot 竞争对手并测试 Sourcegraph 的最新版本 Cody。

Alessandro 亚历山德罗

The Tools of the Trade
行业工具

A section dedicated to the interesting new AI-powered solutions that can improve productivity and increase the quality of life. No, beta products and Join the waitlist gimmicks don’t count. And no, it’s not a sponsored thingy.
一个专门介绍有趣的新型 AI 驱动解决方案的部分,这些解决方案可以提高生产力并改善生活质量。不,测试产品和加入候补名单的噱头不算。而且,不,这不是一个赞助的东西。

In the introduction of Issue #16 – Discover Your True Vocation With AI: The Dog Walker, I talked how I ended up using an application meant for software developers, Visual Studio Code, as my main writing tool.
在问题 #16 的介绍中 – 用 AI 发现你的真实职业:遛狗者,我谈到了我如何最终使用一个针对软件开发人员的应用程序 Visual Studio Code 作为我的主要写作工具。

If you haven’t read it, please go ahead and do so now. It’s critical to understand the context of today’s newsletter.
如果你还没有阅读,请现在去阅读。理解今天新闻通讯的背景至关重要。

If you have read it, you know that I discovered, by accident, how CoPilot, the GitHub extension for VS Code based on GPT-4, is the ultimate help for writers, not just software developers.
如果你已经阅读过,你就知道我意外发现,基于 GPT-4 的 GitHub 扩展 CoPilot 是作家的终极助手,而不仅仅是软件开发人员的助手。

What I didn’t tell you in that introduction is that, together with CoPilot, I use several additional extensions (some discovered just days ago) that have transformed my writing workflow to the point that today I can’t imagine writing anything of substance without VS Code.
我在介绍中没有告诉你的是,除了 CoPilot,我还使用了几个额外的扩展(有些是几天前才发现的),这些扩展彻底改变了我的写作工作流程,以至于今天我无法想象在没有 VS Code 的情况下写任何有实质内容的东西。

So, today, we talk about how VS Code can become the ultimate life-changing personal writing tool, beating hands down any other tool you ever tried, from Ulysses to Scrivener, from Word to Google Docs.
所以,今天我们来谈谈 VS Code 如何成为终极改变生活的个人写作工具,轻松超越你曾经尝试过的任何其他工具,从 Ulysses 到 Scrivener,从 Word 到 Google Docs。

Notice that I said, “personal”. The one shortcoming of using VS code to write is that it doesn’t have a collaboration feature, but so do many other writing apps on the market today. What I got with VS Code plus the extensions I’ll talk about below is so valuable that I’m happy to copy my draft from VS Code to Google Docs for the final editing and collaboration phase rather than write the whole thing there.
注意我说的是“个人”。使用 VS Code 写作的一个缺点是它没有协作功能,但市场上许多其他写作应用程序也是如此。我在 VS Code 及下面要讨论的扩展中获得的价值是如此之高,以至于我乐意将我的草稿从 VS Code 复制到 Google Docs 进行最终编辑和协作阶段,而不是在那儿写整个内容。

It’s that good. 它真的很好。

We need to talk about three things: the extensions, the native tools, and the configuration of the environment. One complements the others and together they power my workflow.
我们需要讨论三件事:扩展、原生工具和环境配置。它们相辅相成,共同推动我的工作流程。

Before we start, three caveats:
在我们开始之前,有三个警告:

  1. I know that there are some articles online on how to turn VS Code into a writing tool. I found them either obsolete or incomplete. I think I have put together a more comprehensive set of extensions than any article I’ve found so far.
    我知道网上有一些关于如何将 VS Code 转变为写作工具的文章。我发现它们要么过时,要么不完整。我认为我整理出了一套比我找到的任何文章都更全面的扩展。
  2. My configuration is tailored after my use cases: writing Synthetic Work in the way it must be written is the main one, but not the only one. I hope you’ll find some information that is valuable and can be adapted to your use cases.
    我的配置是根据我的使用案例量身定制的:以必须的方式编写合成工作是主要的,但不是唯一的。我希望你能找到一些有价值的信息,并可以适应你的使用案例。
  3. This will be a little bit more geeky than I’d like Synthetic Work to be. I wouldn’t recommend you to go through the steps I’m about to describe if there wasn’t an enormous return on the investment. Bear with me on this.
    这将比我希望的合成工作更具技术性。如果没有巨大的投资回报,我不建议你按照我接下来要描述的步骤进行。请耐心听我说。

OK. Let’s start with the extensions.
好的。让我们从扩展开始。

Extensions 扩展

  • WordCounter 字数统计器
  • Grammarly
  • GitHub Copilot
  • Auto Rename Tag 自动重命名标签
  • TODO Highlight TODO 高亮
  • ChatIDE

Let’s talk about each of these extensions:
让我们谈谈这些扩展的每一个:

WordCounter 字数统计器

This little extension is amazing. Not just because it counts words, characters, lines, and paragraphs. And not just because it can do so for a selection rather than the whole text if you wish so. But, crucially, also because it estimates the reading time of what you are writing.
这个小扩展真是太棒了。不仅因为它可以计算单词、字符、行和段落的数量。也不仅因为如果你愿意,它可以对选定的文本而不是整个文本进行计算。但更重要的是,它还可以估算你所写内容的阅读时间。

One of the biggest challenges I have writing Synthetic Work is trying to find the right balance in terms of content length. Before moving to VS Code, I searched, in vain, for a reading time tool that would work with the other writing tools I was using.
我在写合成作品时面临的最大挑战之一是找到内容长度的正确平衡。在转向 VS Code 之前,我徒劳地寻找一个可以与我使用的其他写作工具配合的阅读时间工具。

Not finding one, I simply tried to reach the same length of the past newsletters, through a highly imprecise visual inspection of the scrolling bar. Yep, I have no shame in admitting that.
没有找到一个,我只是通过对滚动条的高度不精确的视觉检查,尽量达到过去新闻通讯的相同长度。是的,我毫不羞愧地承认这一点。

Now I have a precise comparison term and a sense of how long I’ll bore you every week.
现在我有了一个精确的比较标准,以及对我每周会让你感到无聊多久的感觉。

Grammarly

We talked about Grammarly extensively in Issue #11 – Personalized Ads and Personalized Tutors.
我们在第 11 期中详细讨论了 Grammarly - 个性化广告和个性化辅导。

In Issue #16 – Discover Your True Vocation With AI: The Dog Walker, I also told you that the whole reason why I started using VS Code was that the Grammarly implementation of the VS Code extension is much better than any other I’ve tried for any other editor.
在第 16 期 - 用 AI 发现你的真实职业:遛狗者中,我还告诉过你,我开始使用 VS Code 的原因是,VS Code 扩展的 Grammarly 实现比我尝试过的任何其他编辑器的都要好得多。

The popup could use some more contrast between the suggestion and the background text, but it’s probably possible to customize it in ways I didn’t bother to explore yet.
弹出窗口的建议与背景文本之间的对比度可以更高一些,但可能可以以我尚未探索的方式进行自定义。

The second best thing about this extension is that it shows you the entire list of errors and suggestions in a panel on the left or right side of the main editor. This allows me to catch errors and typos that I would have missed by scrolling through the draft trying to spot the red underlines.
这个扩展的第二个最佳功能是它在主编辑器的左侧或右侧面板中显示整个错误和建议列表。这让我能够捕捉到我在滚动草稿时试图找到红色下划线而错过的错误和拼写错误。

Notice that this extension doesn’t support yet the new version of Grammarly powered by large language models called GO. But it’s not important as Copilot will do that job for you.
请注意,此扩展尚不支持由大型语言模型驱动的新版本 Grammarly,称为 GO。但这并不重要,因为 Copilot 会为您完成这项工作。

GitHub Copilot

The entire reason why VS Code is mentioned in The Tools of The Trade section.
提到 VS Code 的整个原因在于《工具交易》的部分。

As we said multiple times in past issues of Synthetic Work, the Copilot extension is based on a model that OpenAI has trained for GitHub called Codex.
正如我们在《Synthetic Work》的过去几期中多次提到的,Copilot 扩展是基于 OpenAI 为 GitHub 训练的一个模型,称为 Codex。

While this version of Copilot mainly acts as an autocomplete system, its upcoming successor, called X, will be based on GPT-4 and it will also behave like ChatGPT, allowing you to have a conversation with the AI about the code you are writing inside VS Code.
虽然这个版本的 Copilot 主要作为自动补全系统,但它即将推出的继任者 X 将基于 GPT-4,并且它也会像 ChatGPT 一样,允许你与 AI 进行关于你在 VS Code 中编写的代码的对话。

I currently use the technical preview of Copilot X, which you can sign up for here.
我目前使用 Copilot X 的技术预览版,您可以在这里注册。

First, you have to be a paying customer for the current version of CoPilot. Then, you can apply for the technical preview and hope to be selected. I was selected immediately.
首先,您必须是当前版本 CoPilot 的付费客户。然后,您可以申请技术预览并希望被选中。我立即被选中了。

Unfortunately, if you already pay to access GPT-4 through the OpenAI GPT Plus subscription, there’s no way to leverage that for Copilot. You have to pay Copilot as a separate system.
不幸的是,如果您已经通过 OpenAI GPT Plus 订阅支付以访问 GPT-4,那么没有办法将其用于 Copilot。您必须单独支付 Copilot。

Dozens of extensions for VS Code that allow you to use the GPT-4 API, but you have to pay for the API consumption separately and they don’t do the autocomplete magic that I’m talking about here.
数十个用于 VS Code 的扩展,允许你使用 GPT-4 API,但你必须单独支付 API 消耗费用,并且它们并没有实现我在这里提到的自动完成功能。

I don’t know if my experience is so amazing because I’m using the technical preview of Copilot X or if it would be as good even with the version of Copilot that uses Codex. If you try the latter, let me know your impressions.
我不知道我的体验是否如此惊人是因为我正在使用 Copilot X 的技术预览版,还是即使使用 Codex 的 Copilot 版本也会如此好。如果你尝试后者,请告诉我你的感受。

As I said in Issue #16 – Discover Your True Vocation With AI: The Dog Walker, the suggestions I receive from Copilot occasionally are so good that it seems like it’s reading my mind.
正如我在问题 #16 中所说的 – 用 AI 发现你的真实职业:遛狗者,我从 Copilot 收到的建议有时好得令人惊讶,似乎它能读懂我的心思。

I’m not always that predictable. Let’s say that 30% of the time, the AI knows exactly what I want to write next, or it suggests a better way to write what I was trying to write before I wrote it.
我并不总是那么可预测。假设有 30%的时间,AI 确切知道我接下来想写什么,或者在我写之前,它建议了一种更好的写法。

I’m not certain it’s 30%. It’s hard to measure it, but even I can assure you that the number of times it works is so high that the impact on the writing speed is material. So material to sit here and advocate its use to you in two issues of this newsletter. Despite the technicalities you need to go through to make it work. Despite the price.
我不确定它是 30%。很难测量,但即使我也可以向你保证,它工作的次数是如此之高,以至于对写作速度的影响是显著的。因此,我在这份通讯的两个问题中坐在这里倡导它的使用。尽管你需要经历一些技术细节才能使其工作。尽管价格。

You have to try the experience for two weeks to understand its value.
你必须尝试这个体验两周才能理解它的价值。

Now, notice that I’m not letting the AI write your newsletter. I fiercely push back any recommendation that is even remotely diverging from what I intend to write. As I said, I exclusively use it to speed up the act of writing something I already decided to write.
现在,请注意我并没有让 AI 来写你的通讯。我坚决反对任何与我打算写的内容稍有偏离的建议。正如我所说,我只使用它来加快我已经决定要写的内容的写作过程。

And this is the key difference between using ChatGTP and Copilot. While the underlying AI model is the same, your intention is very different.
这就是使用 ChatGTP 和 Copilot 之间的关键区别。虽然底层的 AI 模型是相同的,但你的意图却截然不同。

You use ChatGTP when you are not quite sure how to express what you want to say. You use it for inspiration or for a different perspective on a first draft you already wrote.
当你不太确定如何表达你想说的内容时,你会使用 ChatGTP。你用它来获得灵感或对你已经写好的初稿提供不同的视角。

You, instead, use Copilot when you are certain about what you want to write and you just need to execute faster.
相反,当你确定自己想写什么时,你会使用 Copilot,而你只需要更快地执行。

Both approaches have merits and both are worth every penny for me.
这两种方法都有其优点,对我来说都是值得每一分钱的。

That said, the cost of these AI services can add up quickly. Are there alternatives that you could consider?
话虽如此,这些 AI 服务的费用可能会迅速累积。你是否可以考虑其他替代方案?

At least three alternatices, in a future, could replace Copilot in the workflow we are describing today: Google Bard, AWS CodeWhisperer, and Sourcegraph Cody.
至少有三个替代品,在未来,可能会取代我们今天所描述的工作流程中的 Copilot:Google Bard、AWS CodeWhisperer 和 Sourcegraph Cody。

Bard

Google is preparing to infuse Workspace apps (Docs, Sheets, Slides, etc.) with its model: Bard. You’ll hit a button floating inside a Google Docs page and you’ll be able to ask the AI to help you start. That’s not the same as the autocomplete capability I’m talking about here.
谷歌正在准备将其模型 Bard 注入 Workspace 应用程序(文档、表格、幻灯片等)。您将在 Google Docs 页面中点击一个浮动按钮,您将能够请求 AI 帮助您开始。这与我在这里所说的自动完成功能并不相同。

Plus, Bard hallucinates like there’s no tomorrow and I would highly recommend you wait for a better version or the next-generation model: Gemini, developed by DeepMind.
此外,Bard 的幻觉效果非常强烈,我强烈建议您等待更好的版本或下一代模型:由 DeepMind 开发的 Gemini。

Finally, and most importantly, Google is so uncertain about the quality of Bard’s answers that, in your Terms of Service agreement, you will find that the company will allow human reviewers to read your prompts and the AI-generated answers to monitor the quality of the service.
最后,也是最重要的,谷歌对 Bard 回答质量的信心如此不足,以至于在您的服务条款协议中,您会发现公司允许人工审核员阅读您的提示和 AI 生成的答案,以监控服务质量。

What’s not to love?
有什么不好呢?

CodeWhisperer 代码低语者

Like Copilot, CodeWhisperer is available as a VS Code extension. Unlike Copilot, it’s free. And you don’t even need to be an AWS customer to use it.
与 Copilot 一样,代码低语者作为 VS Code 扩展可用。与 Copilot 不同,它是免费的。您甚至不需要成为 AWS 客户就可以使用它。

However, I did not test it yet to see if it can autocomplete plain English as Copilot does and if it’s equally good at it. If it doesn’t do it today, it might in the future.
然而,我还没有测试它是否能像 Copilot 那样自动完成普通英语,以及它的表现是否同样出色。如果今天不能做到,未来可能会做到。

Cody

Sourcegraph announced Cody 5.1 as soon as I finished this draft, so I had to go back and add this paragraph. Something like that happens to me every week. That’s how dynamic things are in the AI industry.
Sourcegraph 宣布 Cody 5.1 就在我完成这篇草稿后发布,所以我不得不回去添加这一段。每周我都会遇到类似的事情。这就是 AI 行业的动态。

Like Copilot and CodeWhisperer, Cody comes as a VS Code extension to provide code completions and suggestions. The AI model that Sourcegraph is using for Cody 5.1 has not been trained in-house but it’s a version of Claude, the foundation model developed by Anthropic.
像 Copilot 和 CodeWhisperer 一样,Cody 作为 VS Code 扩展提供代码补全和建议。Sourcegraph 为 Cody 5.1 使用的 AI 模型并不是内部训练的,而是 Anthropic 开发的基础模型 Claude 的一个版本。

Another trick that Cody uses is this: if you are willing to install an auxiliary app on your computer, Cody can look into all the files you have created across multiple directories and use them as context to write its autocomplete suggestions.
Cody 使用的另一个技巧是:如果您愿意在计算机上安装一个辅助应用程序,Cody 可以查看您在多个目录中创建的所有文件,并将它们用作上下文来编写其自动完成建议。

By comparison, at least for now, Copilot can only look at the current file you are editing.
相比之下,至少目前,Copilot 只能查看您正在编辑的当前文件。

The question is if Cody can do plain English autocomplete and how well compared to Copilot. I installed it and can confirm that it does autocomplete in the same way Copilot does.
问题是 Cody 是否可以进行普通英语的自动完成,以及与 Copilot 相比效果如何。我安装了它,可以确认它的自动完成方式与 Copilot 相同。

The positive things: it’s completely free, and it’s capable of keeping a lot in context. As I’m typing this sentence, it suggested something that references another sentence I wrote at the very beginning of this draft, 4,000 words ago.
积极的方面:它是完全免费的,并且能够保持很多上下文。当我输入这句话时,它建议了一些与我在这篇草稿开头写的另一句话相关的内容,距今已有 4000 个单词。

The negative thing: it’s a split-second slower in generating its recommendations compared to Copilot. It seems an insignificant amount of time, but it impacts the experience in a material way. When you compare the two, you suddenly notice how important is the generation’s speed to boost your writing in the way I described it in the past.
负面因素:与 Copilot 相比,它在生成推荐时慢了一瞬间。看似微不足道的时间,但在体验上产生了实质性的影响。当你比较两者时,你会突然意识到生成速度对提升你的写作有多么重要,正如我过去所描述的那样。

Now. Cody is in beta, and generation speed could significantly increase going forward. I’d keep an eye on this one.
现在。Cody 处于测试阶段,未来生成速度可能会显著提高。我会关注这一点。

Others 其他

There will be many other AI assistants in the future and they will be free: the progress that I’m seeing with open access large language models like Falcon, Guanaco, and MPT is impressive. Differently from the perennially hyped AI community, I’m not confident that these models are ready today, but the trajectory is very promising.
未来会有许多其他的 AI 助手,它们将是免费的:我看到的开放访问的大型语言模型,如 Falcon、Guanaco 和 MPT 的进展令人印象深刻。与永远被炒作的 AI 社区不同,我并不相信这些模型今天已经准备好,但其发展轨迹非常有希望。

Also, the entire AI community is waiting to see how StableLM, developed by Stable Diffusion, will pan out.
此外,整个 AI 社区都在等待看看由 Stable Diffusion 开发的 StableLM 将如何发展。

As we speak, StableLM is about to enter its beta phase, so there’s still a long way to go before its release, but Stability AI has already demonstrated exceptional training skills with Stable Diffusion Extra Large (SDXL) 0.9.
在我们交谈的同时,StableLM 即将进入其测试阶段,因此在发布之前还有很长的路要走,但 Stability AI 已经展示了其在 Stable Diffusion Extra Large (SDXL) 0.9 上的卓越训练能力。

I’m confident StableLM may trigger an explosion of activity in 2024.
我相信 StableLM 可能会在 2024 年引发一场活动的爆炸。

Auto Rename Tag 自动重命名标签

As you know, I write two editions of this newsletter every week. Each one is approximately 10 pages of content, divided into multiple sections.
正如你所知,我每周写两版这个新闻通讯。每一版大约有 10 页内容,分为多个部分。

I don’t write the drafts in plaintext. I need markup to indicate the sections, the titles, the links, the images, the bullet points, and so on.
我不以纯文本写草稿。我需要标记来指示部分、标题、链接、图像、项目符号等。

I don’t like Markdown, as it doesn’t give me the flexibility I need to customize the look and feel of the content when it appears on the website. Plus, I find it pointless: Markdown must be converted to HTML to be displayed on a website or inside the HTML emails that deliver modern newsletters.
我不喜欢 Markdown,因为它没有给我所需的灵活性来定制内容在网站上显示时的外观和感觉。此外,我觉得这毫无意义:Markdown 必须转换为 HTML 才能在网站上或发送现代新闻通讯的 HTML 邮件中显示。

I am well-versed in designing websites with HTML and CSS, so I mark up the newsletter content directly in HTML. This will be important to understand why I use some of the extensions listed below.
我精通使用 HTML 和 CSS 设计网站,因此我直接在 HTML 中标记新闻通讯内容。这将有助于理解我为什么使用下面列出的一些扩展。

Because of this, a little extension called Auto Rename Tag helps me avoid mistakes.
因此,一个叫做 Auto Rename Tag 的小扩展帮助我避免错误。

If I’m changing the starting tag of a title, for example from h3 to h4, it automatically changes the closing tag, too. And vice versa.
例如,如果我正在更改标题的起始标签,从 h3 更改为 h4,它也会自动更改闭合标签。反之亦然。

Super simple, super useful.
超级简单,超级实用。

TODO Highlight TODO 高亮

Once a draft of this newsletter is complete, before it ends up in your email, it must be first copied inside the editor that comes with WordPress. WordPress has been my platform of choice for every media project I created in over two decades, and it powers Synthetic Work, too.
一旦这份新闻稿的草稿完成,在它进入你的电子邮件之前,必须先复制到 WordPress 自带的编辑器中。WordPress 是我在过去二十多年中为每个媒体项目选择的平台,它也为 Synthetic Work 提供支持。

My WordPress implementations are always heavily customized to accommodate the creation of special tools and features for the readers. Synthetic Work is the most complex WordPress implementation I’ve created so far and some of the tools you see today, like the AI Tracker, are the result of these customizations.
我的 WordPress 实现总是经过大量定制,以便为读者创建特殊工具和功能。Synthetic Work 是我迄今为止创建的最复杂的 WordPress 实现,您今天看到的一些工具,如 AI Tracker,都是这些定制的结果。

Due to these customizations, and for reasons that will become clear in the future, I can’t simply copy the whole draft written in VS Code into WordPress. I need to copy and paste each section separately. So it’s very important that I can easily identify each section in the draft during the copy-and-paste process.
由于这些定制,以及将来会变得清晰的原因,我不能简单地将 VS Code 中编写的整个草稿复制到 WordPress。我需要分别复制和粘贴每个部分。因此,在复制和粘贴过程中,我能够轻松识别草稿中的每个部分是非常重要的。

The problem here is that, since I write a plaintext file, there is no way to visually identify the sections of the draft and so it was a lot of scrolling up and down, endlessly re-reading pieces of my draft to find the right section to copy into WordPress.
问题在于,由于我写的是一个纯文本文件,因此无法直观地识别草稿的各个部分,所以我不得不不停地上下滚动,无休止地重读草稿的片段,以找到正确的部分复制到 WordPress 中。

I solved this problem with a simple extension called TODO Highlight.
我通过一个叫做 TODO Highlight 的简单扩展解决了这个问题。

This little guy allows you to change the appearance of an arbitrary string of text as you type it. You can change the color of the font, the color of the background, the color of the border, and even ask that the entire line is highlighted rather than just the characters of the string.
这个小家伙允许你在输入文本时更改任意字符串的外观。你可以更改字体的颜色、背景的颜色、边框的颜色,甚至可以要求整行被高亮显示,而不仅仅是字符串的字符。

So I use it to highlight everything that is within the h2 tags, which I use to mark the beginning of each section of the newsletter.
所以我用它来突出显示所有在 h2 标签内的内容,这些标签用于标记每个新闻通讯部分的开始。

This is probably one of the most challenging extensions to configure, as it requires you to write a regular expression (RegEx) to identify the string you want to highlight. And regular expressions are a nightmare even for developers.
这可能是最具挑战性的扩展之一,因为它要求您编写一个正则表达式(RegEx)来识别您想要高亮的字符串。而正则表达式即使对开发人员来说也是一场噩梦。

In the past, I would have discouraged you from using this extension because of this complexity, but today we have a friend to help us: ChatGPT.
过去,我会因为这个复杂性而劝阻您使用这个扩展,但今天我们有一个朋友来帮助我们:ChatGPT。

Just ask it to write the regular expression for the text that you want to highlight. The free GPT-3.5 model is good enough for this task, you don’t need to pay for GPT-4.
只需让它为您想要高亮的文本编写正则表达式。免费的 GPT-3.5 模型足够满足这个任务,您不需要为 GPT-4 付费。

Then, put it in the configuration file of the extension. It’s another intimidating thing to do, but you’ll manage.
然后,将其放入扩展的配置文件中。这是另一件令人畏惧的事情,但你会成功的。

I had more challenges finding the perfect background color for the dark mode theme that I use with VS Code than configuring the extension.
我在为我在 VS Code 中使用的暗黑模式主题寻找完美背景颜色时遇到的挑战比配置扩展要多。

Even in this case, ChatGPT was super helpful as it suggested multiple colors that could work in the scenario I specified:
即使在这种情况下,ChatGPT 也非常有帮助,因为它建议了多种可能适用于我指定场景的颜色:

It even offered a way to test them that I didn’t think about:
它甚至提供了一种我没有想到的测试它们的方法:

I need this extension only to generate a visual cue for one single tag, but it can be used to highlight multiple things in infinite ways.
我只需要这个扩展来为一个单一标签生成视觉提示,但它可以以无限的方式突出显示多个内容。

ChatIDE

This last extension is optional but worth mentioning.
这个最后的扩展是可选的,但值得一提。

We saw how, in this particular workflow, ChatGTP and Copilot have different roles. I wish I could use Copilot for everything, but even the new chat capability in the technical preview of Copilot X doesn’t allow me to ask questions about anything that is not code related.
我们看到在这个特定的工作流程中,ChatGTP 和 Copilot 扮演着不同的角色。我希望我能把 Copilot 用于所有事情,但即使是在 Copilot X 的技术预览中,新的聊天功能也不允许我询问与代码无关的任何问题。

So both have to exist. However, for some people can be quite annoying to have to switch between the browser, where ChatGTP lives, and VS Code where you do your writing.
所以两者都必须存在。然而,对于某些人来说,在浏览器(ChatGTP 所在的地方)和 VS Code(你进行写作的地方)之间切换可能相当烦人。

You could use clever apps like MacGPT, which we encountered in Issue #12 – And You Thought That Horoscopes Couldn’t Be Any Worse, reducing the distractions, but you’d still have some context switching.
你可以使用像 MacGPT 这样的聪明应用程序,我们在问题 #12 中遇到过——你以为星座运势不能更糟了,减少干扰,但你仍然会有一些上下文切换。

To minimize that, you could install a VS Code extension that replicates the ChatGPT interface inside VS Code.
为了最小化这一点,您可以安装一个 VS Code 扩展,该扩展在 VS Code 内部复制 ChatGPT 界面。

This approach allows you to ditch your GPT Plus subscription entirely and pay the access to GPT-4 on a consumption basis, which is usually cheaper, accessing it via the API that OpenAI provides you on its platform.openai.com website.
这种方法允许您完全放弃 GPT Plus 订阅,并按使用量支付 GPT-4 的访问费用,这通常更便宜,通过 OpenAI 在其 platform.openai.com 网站上提供的 API 访问。

There are dozens of extensions in VS Code Marketplace that allow you to do so, but I only trust ChatIDE because it’s made by the same developer that makes LM Studio, which I described in Issue #18 – How to roll with the punches.
在 VS Code Marketplace 中有数十个扩展可以让您做到这一点,但我只信任 ChatIDE,因为它是由同一开发者制作的,该开发者制作了我在问题 #18 中描述的 LM Studio – 如何应对挑战。

I know this person and talk to him every day about the development of LM Studio and ChatIDE. I know the care he puts in building his software.
我认识这个人,并且每天和他谈论 LM Studio 和 ChatIDE 的开发。我知道他在构建软件时所投入的关心。

Differently from Copilot, ChatIDE allows you to change the behavior of the AI model by specifying a different conditioning (via a so-called system prompt), which makes it incredibly versatile.
与 Copilot 不同,ChatIDE 允许您通过指定不同的条件(通过所谓的系统提示)来改变 AI 模型的行为,这使得它非常灵活。

You could, for example, ask GPT-4 to behave like a famous writer you want to emulate rather than behaving as a generic very helpful assistant. This saves you from having to assign a role, a technique we saw in Issue #8 – The Harbinger of Change, every time you write a prompt.
例如,你可以让 GPT-4 像你想要模仿的著名作家那样表现,而不是作为一个通用的非常有帮助的助手。这可以让你避免每次写提示时都要分配一个角色,这个技巧我们在第 8 期 - 变革的先驱 中看到过。

Even more interesting than that, ChatIDE supports the API to use Claude, the AI model that competes with GPT-4, developed by Anthropic. Which is the same thing that Cody 5.1 does, as we saw in the Copilot section of this long issue.
更有趣的是,ChatIDE 支持使用 Claude 的 API,这是一种与 GPT-4 竞争的 AI 模型,由 Anthropic 开发。这与我们在这个长问题的 Copilot 部分看到的 Cody 5.1 是一样的。

So this might be an interesting way to compare the two models and see which one is better for your needs.
所以这可能是比较这两个模型并查看哪个更适合您需求的有趣方式。

OK, now it’s time to talk about the native features of VS Code that are critical complements to these extensions.
好的,现在是时候谈谈 VS Code 的本地功能,这些功能是对这些扩展的关键补充。

VS Code Features VS Code 功能

  • Explorer 资源管理器
  • Snippets 代码片段
  • Emmet
  • Autosave 自动保存
  • Git

Explorer 资源管理器

The Explorer is a file manager integrated inside VS Code.
资源管理器是集成在 VS Code 内部的文件管理器。

For a very long time, I ignored its value. I didn’t see anything particularly useful in it compared to using my trusted ForkLift on macOS.
很长一段时间,我忽视了它的价值。与在 macOS 上使用我信任的 ForkLift 相比,我没有看到它有什么特别有用的地方。

Yes, just like ChatIDE, Explorer saves you from context switching, but it’s not particularly important when you work with a single file at a time.
是的,就像 ChatIDE 一样,Explorer 让你免于上下文切换,但当你一次只处理一个文件时,这并不是特别重要。

But Synthetic Work is a newsletter made of two drafts per week, and many images that I save locally and need to upload to WordPress. It’s becoming a lot of files.
但是 Synthetic Work 是一份每周两篇草稿的新闻通讯,还有许多我本地保存并需要上传到 WordPress 的图片。这变成了很多文件。

And, crucially, in most drafts, I often reference previous issues of the newsletter. The content is so much that I don’t always remember in what Issue I wrote X or Y or Z, and I need a more efficient way to find the things I previously wrote than going online every time and browsing the website.
而且,关键是,在大多数草稿中,我经常引用之前的通讯期刊。内容太多,以至于我并不总是记得我在第几期写了 X、Y 或 Z,我需要一种比每次在线浏览网站更有效的方式来找到我之前写的东西。

So, I have set up VS Code to define a so-called workspace that points to the hard drive folder that contains all my sub-folders, one for each issue of Synthetic Work.
所以,我已经设置了 VS Code 来定义一个所谓的工作区,该工作区指向包含我所有子文件夹的硬盘文件夹,每个子文件夹对应 Synthetic Work 的一个期刊。

The Explorer allows me to browse the content of all these sub-folders, create new ones, create and rename the new draft files, delete stuff. It’s, once again, a faster way to do things that I would normally do in another app.
资源管理器允许我浏览所有这些子文件夹的内容,创建新的子文件夹,创建和重命名新的草稿文件,删除内容。这再次是一个比我通常在其他应用程序中做的事情更快的方法。

More importantly, once I defined the Workspace, I can search for content across all the files in all the sub-folders with the Search feature of VS Code:
更重要的是,一旦我定义了工作区,我可以使用 VS Code 的搜索功能在所有子文件夹中的所有文件中搜索内容:

It’s so convenient and so much faster than using the search feature in macOS, Finder, or ForkLift.
这比在 macOS、Finder 或 ForkLift 中使用搜索功能方便得多,速度也快得多。

So, for apparently insignificant reasons, Explorer makes me very happy.
所以,出于看似微不足道的原因,Explorer 让我非常开心。

Snippets 代码片段

As you perfectly know, each Edition of Synthetic Work has its regular sections that appear almost every week. Every time I start a new draft, I have to create the same sections over and over again. It’s time that can be saved by using a template.
正如你所知道的,每个 Synthetic Work 的版本都有其定期出现的部分,几乎每周都会出现。每次我开始一个新草稿时,我都必须一次又一次地创建相同的部分。这是可以通过使用模板来节省的时间。

VS Code allows you to create templates for any kind of file, via a feature called Snippets.
VS Code 允许你为任何类型的文件创建模板,通过一个叫做代码片段的功能。

Exceptionally awkward to use, you can define your templates/snippets in a particular file. The snippet can be a single line or multiple lines. If it’s multiple lines, you’ll have to follow a particular syntax.
使用起来非常尴尬,你可以在特定文件中定义你的模板/代码片段。代码片段可以是一行或多行。如果是多行,你需要遵循特定的语法。

The beauty of this thing is that you assign a shortcut to each snippet. When you type the characters of your shortcut, the VS Code autocomplete function (nothing to do with Copilot!) will suggest the snippet and, if you accept the suggestion, it will expand your shortcut into the full template you have previously defined.
这个东西的美在于你可以为每个代码片段分配一个快捷键。当你输入快捷键的字符时,VS Code 的自动完成功能(与 Copilot 无关!)会建议该代码片段,如果你接受建议,它会将你的快捷键扩展为你之前定义的完整模板。

For example, I created two shortcuts. One is !fe and one is !se.
例如,我创建了两个快捷方式。一个是 !fe,另一个是 !se。

When I start a new Free Edition draft, I type !fe in the editor and VS Code suggests me the right snippet:
当我开始一个新的免费版草稿时,我在编辑器中输入 !fe,VS Code 会建议我正确的代码片段:

If I accept the suggestion, the snippet expands into the full template:
如果我接受建议,代码片段将展开为完整的模板:

Notice that the sections of the newsletter are already colored following the rule I defined in the TODO Highlight extensions as I explained above.
请注意,新闻通讯的各个部分已经按照我在 TODO Highlight 扩展中定义的规则着色,正如我上面所解释的。

I love this thing.
我喜欢这个东西。

Emmet

This is the most magical thing in VS Code after Copilot. Every web developer in the world knows about Emmet, but I didn’t (I’m not a web developer) and when I discovered it, I felt like an idiot.
这是 VS Code 中继 Copilot 之后最神奇的事情。世界上每个网页开发者都知道 Emmet,但我不知道(我不是网页开发者),当我发现它时,我觉得自己像个傻瓜。

Emmet is a plugin that comes pre-installed in VS Code. It allows you to write HTML and CSS tags via shortcuts in an impossibly clever way.
Emmet 是一个在 VS Code 中预装的插件。它允许你通过快捷方式以一种不可思议的聪明方式编写 HTML 和 CSS 标签。

For each newsletter draft, I have to write HTML tags for section titles, links, quotes, italic and bold text, and lists. A ton of these things.
对于每个新闻稿草稿,我必须为章节标题、链接、引用、斜体和粗体文本以及列表编写 HTML 标签。这些东西有很多。

Writing these tags takes just fractions of seconds, but when you add them up, they slow your writing down in a material way.
编写这些标签只需几分之一秒,但当你把它们加起来时,它们会在实质上减慢你的写作速度。

Emmet allows me to write these tags in a fraction of a second.
Emmet 让我在几分之一秒内编写这些标签。

For example, let’s say that I need to create a list of eight items, like the list of extensions in the previous section of this article.
例如,假设我需要创建一个包含八个项目的列表,就像本文前一部分中的扩展列表。

Rather than manually writing the tags for each item, I invoke Emmet with a keyboard shortcut I set up, and then I write:
我不是手动为每个项目编写标签,而是通过我设置的键盘快捷键调用 Emmet,然后我写:

And it happens. It does happen. Like a miracle.
而且它发生了。确实发生了。就像一个奇迹。

Do I have to transform a piece of text that I copied from a news source into a quote? I select the text, then invoke again Emmet with the keyboard shortcut I defined, and type bq.
我是否需要将从新闻来源复制的一段文本转换为引用?我选择文本,然后再次通过我定义的键盘快捷键调用 Emmet,并输入 bq。

You know crying tears of joy? That.
你知道喜极而泣吗?就是那样。

The number of things you can do with Emmet is mind-blowing.
使用 Emmet 可以做的事情数量令人震惊。

Autosave 自动保存

Perhaps minor, I didn’t know that VS Code has an autosave feature. It’s not enabled by default, but it’s easy to enable it.
也许是小事,我不知道 VS Code 有自动保存功能。默认情况下未启用,但启用它很简单。

If you dig into the Preferences, you can also change the behavior of the autosave feature, but the default settings are fine for me.
如果你深入到首选项中,你还可以更改自动保存功能的行为,但默认设置对我来说很好。

Git

VS Code obviously supports Git for version control. This is way too technical and out of scope to explain in detail here.
VS Code 显然支持 Git 进行版本控制。这在这里解释得太技术性且超出范围。

I’ll just say that I save all Synthetic Work drafts and images in a private GitHub repository via the Git integration in VS Code.
我只想说,我通过 VS Code 中的 Git 集成将所有 Synthetic Work 草稿和图像保存在一个私有的 GitHub 仓库中。

Having revisions of my drafts makes me sleep better at night.
拥有我草稿的修订版让我晚上睡得更好。

It’s also a way to better understand how to use this GitHub that the entire world uses to write software.
这也是更好地理解如何使用这个全世界都在用来编写软件的 GitHub 的一种方式。

And now, the final part: the configuration of the environment.
现在,最后一部分:环境的配置。

Configuration 配置

VS Code is made of a myriad of panels and tabs and that’s what makes it very intimidating at first. That, alongside the reputation of being a tool for software developers, makes it a hard sell for writers.
VS Code 由无数面板和选项卡组成,这使得它在开始时非常令人生畏。此外,它作为软件开发工具的声誉,使得它对作家来说很难推销。

So how to rearrange those visual elements, and how the application looks and feels, is crucial to me. Here, too, VS Code shows more flexibility than anything else I’ve ever used.
因此,如何重新排列这些视觉元素,以及应用程序的外观和感觉,对我来说至关重要。在这一点上,VS Code 显示出比我使用过的任何其他工具都更大的灵活性。

The way I prefer to work is by having the so-called Primary Side Bar on the right, not on the left where it is by default.
我喜欢的工作方式是将所谓的主侧边栏放在右侧,而不是默认的左侧。

You can change its position by clicking on the top far right icon that allows you to customize the layout. This is how mine is set up today:
您可以通过单击右上角的图标来更改其位置,该图标允许您自定义布局。这是我今天的设置:

When I write a draft, I always have the Primary Side Bar open on the right (usually focused on Grammarly, occasionally on Explorer):
当我写草稿时,我总是将右侧的主侧边栏打开(通常专注于 Grammarly,有时关注 Explorer):

VS Code allows you to have a Secondary Side Bar, where I could place Explorer, but given that I use it only at the beginning of a new draft, it seems a waste of precious real estate.
VS Code 允许你拥有一个辅助侧边栏,我可以在其中放置资源管理器,但考虑到我只在新草稿开始时使用它,这似乎是浪费宝贵的空间。

If Copilot would behave like ChatGPT, I would keep the chat feature always open in the Secondary Side Bar. Given that it doesn’t, I prefer to dedicate space to ChatIDE.
如果 Copilot 像 ChatGPT 一样工作,我会在侧边栏中始终保持聊天功能开启。鉴于它不是这样,我更愿意将空间专用于 ChatIDE。

Finally, a comment about the theme that you see in the screenshots. This is the Dark Modern theme. I’m not crazy about it, but I couldn’t find anything aesthetically more pleasing that wouldn’t compromise readability or strain my eyes.
最后,关于您在屏幕截图中看到的主题的评论。这是黑暗现代主题。我对它并不疯狂,但我找不到任何在美学上更令人愉悦而又不妨碍可读性或使我的眼睛疲劳的主题。

There are hundreds of themes. I’ve tried dozens. I can’t be here all day to try themes.
有数百种主题。我试过几十种。我不能整天在这里尝试主题。


To close: I tried an almost infinite variety of writing tools and workflows in the last two decades. They were either too complicated to set up and use or too limited in capabilities.
最后:在过去的二十年里,我尝试了几乎无限种写作工具和工作流程。它们要么设置和使用起来太复杂,要么功能太有限。

Visual Studio Code, configured as I described, is the first system I’m truly happy with. It’s not too hard to configure and it’s immensely powerful.
正如我所描述的,配置好的 Visual Studio Code 是我真正满意的第一个系统。它的配置并不太难,而且功能强大。

Thanks to Copilot, it’s critically useful even for writing shorter pieces and I highly encourage you to experiment with it.
多亏了 Copilot,它在写短篇时也极其有用,我强烈鼓励你尝试使用它。

I’m sure I’m not saying anything new to people that already use it to develop software, but to the rest of you, I hope this article will help you super-power your writing as it did with mine.
我相信我对已经使用它开发软件的人来说并没有说什么新鲜事,但对其他人来说,我希望这篇文章能像帮助我一样帮助你提升写作能力。