使Visual Studio代码更好

A text editor for a developer is everything. As a programmer, we sit and edit text all day long, every day. We spend most of our time looking at code and finding the best solutions to problems. Reading and writing. Thinking about why this function or that method doesn’t work. Stepping through the code line by line, variable by variable, and squashing 🐛 bugs left, right and center. The text editor that you choose determines how you’ll be interacting with your code and development environment.

为开发一个文本编辑器就是一切。 作为程序员,我们每天整天坐下来编辑文本。 我们将大部分时间用于查看代码并找到解决问题的最佳方法。 读写。 考虑为什么此功能或该方法不起作用。 逐行,逐变量地逐步遍历代码,并向左,向右和向中心挤压🐛bug。 您选择的文本编辑器确定了如何与代码和开发环境进行交互。

Image for post
Photo by Jon Tyson on Unsplash
乔恩·泰森( Jon Tyson)Unsplash

Now, you can use a traditional text editor like Notepad on Windows, or you can get super fancy and develop in XCode only (because Apple requires Apple for Apple). There is VIM, EMACS, Sublime, Nano, Notepad++, gedit, Ulysses. Graphical, non-graphical, and more. However, many text editors are just that: text editors 📝 (who’da thought!), and we as developers need more than something that just stream-edits text to a file.

现在,您可以使用传统的文本编辑器(例如Windows上的记事本),也可以仅使用XCode进行开发(因为Apple需要Apple才能使用Apple )。 有VIM,EMACS,Sublime,Nano,Notepad ++,gedit,Ulysses。 图形,非图形等。 但是,许多文本编辑器就是这样:文本编辑器📝(真想!),而我们作为开发人员不仅需要将文本流编辑到文件中的内容,还需要更多东西。

Personally, I have stuck with Visual Studio Code (VSC or VSCode). It’s been the go-to editor outside of the command line (of which, I’m a full-blown VIM nut, but that’s another story), and the largest reason is because of all the outstanding extensions! The reason that VSC’s extensions are better is that they are actively maintained by the large community 🌐 that uses VSC. It’s really the epitome of open-source: the more eyes you have working on the code, the “better” it’s going to be.

就个人而言,我坚持使用Visual Studio Code(VSC或VSCode)。 它是命令行之外的首选编辑器(其中,我是成熟的VIM坚果,但这是另一回事了),最大的原因是因为所有出色的扩展! VSC扩展更好的原因是它们由使用VSC的大型社区actively积极维护。 这确实是开源的缩影:您对代码的投入越多,它就会越“好”。

With this bit of a primer to “more than just a text editor,” let’s talk about some extensions I’ve found to help my workflow and get programming.

在介绍了“不仅仅是文本编辑器”的基础上,让我们谈谈我发现的一些扩展,这些扩展可以帮助我的工作流程并进行编程。

Image for post
Photo by Petr Macháček on Unsplash
PetrMacháčekUnsplash上的 照片

语言支持🆘(Language Support 🆘)

Since I know a few languages, I like to program in a few languages. There are a lot of little tricks that can carry cross-syntax (I know it’s a fallacy way of thinking, but I still think there is truth there). Thankfully, for the majority of languages, there is an extension available to turn VSCode into an editor for the language you’re using. Such as:

因为我会几种语言,所以我喜欢用几种语言编程。 有很多小技巧可以带有交叉语法(我知道这是一种谬误的思维方式,但我仍然认为那里存在真理)。 幸运的是,对于大多数语言,都有一个扩展程序可以将VSCode变成您所使用语言的编辑器。 如:

Visual Studio IntelliCode

Visual Studio IntelliCode

This extension will give you the same IntelliSense that you’ll get in Visual Studio. It’s not installed by default (which it should be), so it’s first on my list. This extension covers some languages I have other extensions listed to install, but on this one, I think more the merrier is okay.

此扩展将为您提供与Visual Studio中相同的IntelliSense。 默认情况下未安装(应该安装),因此它是我的第一列表。 该扩展程序涵盖了某些语言,我列出了要安装的其他扩展程序,但是在此语言上,我认为更多的是可以的。

Python

Python

One of my favourite scripting languages. Python is something I take out when I want a script fast, and with fast scripts, we’ll also need some fast language support. You can change which version of Python the extension is using in the bottom right corner of VSCode.

我最喜欢的脚本语言之一。 当我想要快速编写脚本时,我会选择Python,而使用快速编写脚本,我们还需要一些快速语言支持。 您可以在VSCode的右下角更改扩展使用的Python版本。

C/C++

C / C ++

The one’s that really made me fall in love with programming: C/C++. Another extension provided by Microsoft, this will give you support on all your C projects, well except C# but….

真正让我爱上了编程的人:C / C ++。 Microsoft提供的另一个扩展,它将为您提供所有C项目的支持,除了C#之外……。

C#

C#

Look at that, we have a C# extension. It’s also from Microsoft (wow!). If you’re doing anything with Unity or .NET, this is a must extension — on top of the IntelliSense mentioned.

看看,我们有一个C#扩展名。 它也来自微软(哇!)。 如果您要使用Unity或.NET进行任何操作,这是必须扩展的功能-在上述IntelliSense的基础上。

Language Support for Java(TM) by Red Hat

Red Hat对Java(TM)的语言支持

Java runs on, what, 12 million machines? Why not have some support just in case you have to open up that legacy Java project.

Java在1200万台计算机上运行? 为什么不提供一些支持,以防万一您必须打开该旧Java项目。

NPM

NPM

The Node Package Manager. The devil to all things front end. While it’s a necessary evil, using this extension can help you with your package.json file, and gives you a handy side-bar tool to run all your scripts.

节点程序包管理器。 万物前端的魔鬼。 虽然这是必然的恶作剧,但使用此扩展程序可以帮助您处理package.json文件,并为您提供方便的侧边栏工具来运行所有脚本。

Deno

天野

Deno is the next greatest TypeScript runtime. That’s right, JavaScript is getting an upgrade, and a secure one too. Deno was created by the creator of NodeJS, so it’s gotta be good, right?

Deno是次佳的TypeScript运行时。 没错,JavaScript正在升级,安全也在升级。 Deno是由NodeJS的创建者创建的,所以它必须很好,对吗?

YAML

YAML

YAML files are great if you need to store data not in JSON files. I’ve never gone fully into the depths of my search as to one over the other, just that I need to use it here and there so I have this extension sitting around when I open those .yaml or .yml files.

如果您需要不将数据存储在JSON文件中,则YAML文件非常有用。 我从来没有完全深入研究彼此之间的联系,只是我需要在这里和那里使用它,因此当我打开那些.yaml.yml文件时,便有了这个扩展名。

格式化/整理 (Formatting / Linting 🚩)

Now, formatting and linting can fall under language support, but there are some extensions made just for formatting and linting languages; and since using them now, I just can’t go back.

现在,格式化和掉毛可以归入语言的支持,但也有格式化和掉毛语言做了一些扩展; 而且既然现在使用它们,我就无法返回。

Bracket Pair Colorizer 2

支架对着色器2

This is one of my favourite extensions (next to IntelliSense). BPC2 just adds that extra *pop* when I’m programming. Especially in Python. When I’m looking to find where the brackets to a function or method meet up, I simply follow the rainbow — literally — to where the pot of bugs is.

这是我最喜欢的扩展之一(IntelliSense旁边)。 BPC2只是在我编程时添加了额外的* pop *。 特别是在Python中。 当我想找到函数或方法的括号的位置时,我只是顺着彩虹—从字面上看—到了bug所在。

Beautify

美化

Beautify is a great code formatter, however, it’s really only great if you’re a front-end developer (as you’ll see in the description of the link).

Beautify是一个很棒的代码格式化程序,但是,只有当您是前端开发人员时,它才真的很棒(如您在链接说明中所见)。

Prettier

更漂亮

I have found Prettier to be the formatter I use most. Again, while it’s mostly useful for front-end devs, I find myself using it whenever Beautify fails me.

我发现Prettier是我使用最多的格式化程序。 再说一次,尽管它对前端开发人员最有用,但是只要Beautify让我失望了,我就会发现自己正在使用它。

EditorConfig for VS Code

VS Code的EditorConfig

EditorConfig is a fantastic project. Re-iterating the beginning of this article, there are so many different editors out there. Let alone operating systems, text formats, etc. There is too much discrepancy in formatting! That’s where a .editorconfig file comes in handy. Most new editors have the ability to read this file in your root project’s folder, and adhere to the formatting rules set there for the project!

EditorConfig是一个很棒的项目。 重新重申本文的开头,那里有许多不同的编辑器。 更不用说操作系统,文本格式等了。格式上的差异太大了! 那就是.editorconfig文件派上用场的地方。 大多数新编辑者都可以在根项目的文件夹中读取此文件,并遵守为项目设置的格式化规则!

ESLint

ESLint

TypeScript officially switched to ESLint last year. Since then, I’ve only used ESLint, and like the rest of the community, I won’t be looking back.

去年,TypeScript正式转换为ESLint。 从那时起,我只使用过ESLint,并且像社区中的其他人一样,我不会回头。

片段✂ (Snippets ✂)

I don’t use snippets as much as I should. But when I do, I install ones already made for me.

我没有尽可能多地使用摘要。 但是,当我这样做时,我会安装已经为我量身定制的产品。

You can also make snippets of your own.

您也可以制作自己的摘录。

其他有用的工具🧰 (Other Useful Tools 🧰)

Couldn’t really think of where else they would go.

真的无法想到他们还会去哪里。

GitLens — Git Supercharged

GitLens —增压的Git

This is a super handy tool for development. While you’re reading over code, the line your cursor is on will show a git-blame on the line, and let you know when it was last updated. This is very handy in team projects.

这是用于开发的超级方便的工具。 在阅读代码时,光标所在的行将在行上显示git-blame,并通知您上次更新的时间。 这在团队项目中非常方便。

TODO Highlighting

TODO突出显示

I use this extension way too much. That said, it helps me track where my task items are in a given file. Not only that, but you can customize and add your own highlights in settings! I use: TODO, NOTE, BUG, REVIEW, TEST for my own notes.

我过多地使用了这种扩展方式。 就是说,这有助于我跟踪任务项在给定文件中的位置。 不仅如此,您还可以自定义并在设置中添加自己的突出显示! 我使用:TODO,NOTE,BUG,REVIEW,TEST作为我自己的笔记。

Debugger for Unity

Unity调试器

Those of you in the game world may have heard about the Unity3d Engine. Well, instead of waiting 8 hours to install Visual Studio, you can install VSCode and this extension in 3 minutes, change your editor preferences in Unity, and away you go!

游戏世界中的那些人可能听说过Unity3d引擎。 好吧,您无需等待8个小时来安装Visual Studio,而是可以在3分钟内安装VSCode和此扩展,在Unity中更改编辑器首选项,然后就不用了!

Docker

码头工人

If you use Docker at all, you may want this extension. Using the Docker extension will give you that little edge of Dockerfile checking as well as, a nifty sidebar tool to help run and manage your Docker containers locally.

如果您完全使用Docker,则可能需要此扩展。 使用Docker扩展将为您提供很少的Dockerfile检查功能,以及一个漂亮的侧边栏工具,可帮助您在本地运行和管理Docker容器。

Auto Comment Block

自动评论块

Comments and documentation are a pain to do, but come in handy any time you step away from a project for a period of time. Those notes are the candle stick in the cave of programming darkness. Take the time to comment right, and with this extension, formatting the comments is a breeze.

注释和文档很辛苦,但是只要您离开项目一段时间,便会派上用场。 这些音符是编程黑暗中的烛台。 花些时间正确评论,使用此扩展程序,格式化注释变得轻而易举。

主题化 (Theming)

Shades of Purple

紫色的阴影

BY FAR my favourite theme for VSCode. I won’t be switching for a while… You just gotta see it for yourself.

BY FAR是我最喜欢的VSCode主题。 我暂时不会切换了……您只需要自己看看即可。

Panda Theme

熊猫主题

My next favourite theme for some of those gloomy days. I really enjoy the simplicity here as well.

在那些令人沮丧的日子里,我的下一个最喜欢的主题是。 我也很喜欢这里的简单性。

vscode-icons

vscode图标

You don’t want to just sit and look at filenames all day do you? NO! Let’s put some nifty icons in VSCode as well, and really make it an experience.

您不想整天坐下来看看文件名吗? 没有! 让我们在VSCode中也放置一些漂亮的图标,并使其真正成为一种体验。

Having these tools in my toolbelt while programming has made my development life much easier, and more colorful. I hope some of you are able to use these extensions to your own benefit. Perhaps you’ll look into more that are an even better fit for your workflow, or you’ll make some amazing extensions of your own! All the power to you, and let’s find or make a shoe 👟 that fits!

在编程时将这些工具放在我的工具带中,使我的开发工作更加轻松,而且更加丰富多彩。 我希望你们中的某些人能够使用这些扩展以使自己受益。 也许您会研究更适合您的工作流程的内容,或者对自己的内容进行一些惊人的扩展! 拥有所有的力量,让我们找到或制造适合的鞋子s!

What’s your favourite editor? Is it VSCode? Is it Visual Studio? Sublime? VIM? Are you an EMACS gal? I’m curious to know what you use! Let’s get the discussion going.

您最喜欢的编辑器是? 是VSCode吗? 是Visual Studio吗? 升华? VIM? 您是EMACS加仑吗? 我很好奇您使用的是什么! 让我们开始讨论。

Thanks for taking the time to read. All the best and stay safe — Spencer

感谢您抽出宝贵的时间阅读。 一切顺利并保持安全— Spencer

升级编码 (Level Up Coding)

Thanks for being a part of our community! Subscribe to our YouTube channel or join the Skilled.dev coding interview course.

感谢您加入我们的社区! 订阅我们的YouTube频道或参加Skilled.dev编码面试课程

翻译自: https://levelup.gitconnected.com/making-visual-studio-code-better-e72105809bf2

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值