gvim文本编辑器帮助

by Evy

由Evy

如何帮助您的文本编辑器帮助您 (How to help your text editor help you)

编写更高效,更有趣的代码的提示和技巧 (Tips & tricks for writing more efficient and enjoyable code)

Over six internships, I’ve had lots of lovely mentors who have watched me code and let me watch them code. (I ? pair programming!) Thanks to them, there are lots of things I’ve learned on the job that have made my work more efficient and enjoyable.

在六个实习期间,我有很多可爱的导师,他们看着我编码,然后让我看着他们编码。 (我要进行空中编程! )多亏了他们,我在工作中学到了很多东西,使我的工作更加高效和有趣。

Some of these things are text editor tips and tricks, and I want to share some of what I’ve learned with you!

其中一些是文本编辑器的技巧和窍门,我想与您分享一些我学到的东西!

This is not a blog post about which text editor you should use. I’ll be sharing some examples in the editor I use these days (Sublime Text on a Mac) — but many text editors are customizable. That means that many of these tips & tricks can be probably be set up in your editor (and I’d love to see comments explaining how!) Let’s get rid of the “this tool is the best” discourse, and just learn how to help our tools help us better. ✨

这不是有关应该使用哪个文本编辑器的博客文章 。 我将在最近使用的编辑器中分享一些示例(在Mac上为Sublime Text),但是许多文本编辑器都是可自定义的。 这意味着可以在您的编辑器中设置许多提示和技巧(我很乐意看到解释方式的注释!)让我们摆脱“此工具是最好的”论述,而只是学习如何帮助我们的工具更好地帮助我们。 ✨

自动为您的代码添加代码 (Automatically lint your code)

Linters can be great for making code cleaner and easier to read, and for catching mistakes. Sometimes I run a linter after I finish a set of changes, or let a linter run online after I open a pull request on GitHub. But I got much faster at writing linter-passing code when the linter ran… as I wrote my code! I have not only stopped making boring tweaks for several minutes before submitting code. I’m also now training myself to fix issues before they even happen.

Linters可以使代码更清晰,更易于阅读,并且可以捕获错误。 有时,在完成一组更改后我会运行一个linter,或者在GitHub上打开一个pull请求后让一个linter在线运行。 但是当linter运行时,我在编写传递linter-pass的代码方面的速度大大提高了……在编写代码时! 在提交代码之前,我不仅停止了数分钟的无聊的调整。 我现在也在训练自己,以便在问题发生之前就将其修复。

80字规 (80 character ruler)

Speaking of arbitrary rules, lots of style guides like lines to be at most 80 characters long (or 100, or something else). Most text editors have a way to add a little line to remind you when you’re at that limit, whatever it is.

说到任意规则,许多样式指南都要求线段的长度最多为80个字符(或100个或其他字符)。 大多数文本编辑器都有一种方法可以添加一小行以提醒您何时达到此极限,无论它是多少。

自动遵循一些空白约定 (Automatically follow some whitespace conventions)

A lot of style guides prefer files to have no trailing whitespace and exactly one new line at the end of each file. It can be hard to remember to do this, so it’s nice when my text editor does it for me! Sublime has this in its user settings: “ensure_newline_at_eof_on_save” and “trim_trailing_white_space_on_save”.

许多样式指南都希望文件没有尾随空格,并且每个文件的末尾只有一行。 很难记住要执行此操作,因此当我的文本编辑器为我执行此操作时非常好! Sublime在其用户设置中具有以下内容: “ensure_newline_at_eof_on_save”“trim_trailing_white_space_on_save”

搜索(并替换)整个代码库 (Search (and replace) over the whole codebase)

When I’m dealing with a codebase of many files, it’s nice to search within it to see all the places something is used or referred to (⌘ shift F on MacOS in Sublime). It’s extra awesome to have the option to search specifically within a certain folder or file type. Sometimes I find it helpful to turn case sensitivity on/off or to use regular expressions — though I don’t use those features often.

当我处理包含多个文件的代码库时,最好在其中进行搜索以查看所有使用或引用过的地方((Sublime中的MacOS上的⌘ shift F )。 可以选择在特定的文件夹或文件类型中进行特定搜索是非常棒的。 有时,我发现打开/关闭区分大小写或使用正则表达式会有所帮助-尽管我并不经常使用这些功能。

快速查找功能定义 (Quickly find function definitions)

Sure, I could search through the codebase for a function name, find its definition, and then figure out how it works. But wouldn’t it be nice to have a way to get there faster?

当然,我可以在代码库中搜索一个函数名称,找到其定义, 然后弄清楚它是如何工作的。 但是,有一种更快到达那里的方法,不是很好吗?

快速查找文件 (Quickly find files)

I often want to find and open a file but don’t remember where exactly it is in the codebase. I love being able to enter the filename in a search bar and see all possible files I am looking for, which lets me open new files quickly. I love the added bonus of a really flexible search input. I can make a whole bunch of typos or leave out parts of the filename and Sublime still can figure out what I want! (I bet the tech behind that search algorithm, often called “fuzzy search”, is pretty interesting!)

我经常想找到并打开一个文件,但不记得它在代码库中的确切位置。 我喜欢能够在搜索栏中输入文件名并查看我正在查找的所有可能的文件,这使我可以快速打开新文件。 我喜欢真正灵活的搜索输入带来的额外好处。 我可以输入很多拼写错误,也可以忽略一部分文件名,Sublime仍然可以弄清楚我想要的是什么! (我打赌这种搜索算法背后的技术,通常称为“ 模糊搜索 ”,非常有趣!)

上下移动线 (Move line(s) up and down)

To move a line of code (or a whole function) below another, I used to use a lot of select + copy + paste. I’ve since figured out how to move lines up and down with a shortcut. It’s a small change, but I find it feels so much nicer (kinda like how amazing three finger drag feels).

要将一行代码(或整个函数)移到另一行下面,我曾经使用很多select + copy + paste。 从那以后,我就知道了如何使用快捷键上下移动行。 这是一个小的变化,但我觉得这感觉好多了 (有点像如何惊人的三周指拖动的感觉)。

语法高亮 (Syntax highlighting)

Syntax highlighting makes reading and scanning code much easier. But it also helps catch mistakes as they’re being typed — if it doesn’t look like it’s colored right, it might be a mistake.

语法突出显示使阅读和扫描代码更加容易。 但这也有助于在键入错误时发现错误-如果看起来颜色不正确,则可能是错误。

Sometimes syntax is highlighted by default. Sometimes only certain languages/technologies are in your default settings. I got a new work laptop and knew I needed to install a package to get jsx highlighting. Yet I still procrastinated it for a few months while working with many jsx files. After I took a minute to install it, things got so much better.

有时默认情况下语法突出显示。 有时,只有某些语言/技术处于您的默认设置中。 我有一台新的工作笔记本电脑,并且知道我需要安装一个软件包才能突出显示jsx 。 但是在处理许多jsx文件时,我仍然拖延了几个月。 我花了一分钟时间安装它之后,情况变得好多了。

Git的东西 (Git stuff)

Lastly, if you use git in your workflow, you can add some support to your text editor to tell you git-related things. One thing I like to see is what lines have been added/deleted/modified since my last commit (a lightweight git diff). I also sometimes use a tool (built around the poorly named git blame) to see who last changed a line in a file.

最后,如果您在工作流程中使用git,则可以向文本编辑器添加一些支持以告诉您与git相关的内容。 我喜欢看的一件事是自上次提交以来添加/删除/修改了哪些行(轻量级git diff )。 有时我还会使用一种工具(围绕名称不佳的 git blame构建)来查看谁最后更改了文件中的一行。

和更多! (And more!)

There are lots of cool things your text editor can do for you! I’m sure I’ll continue to learn about tools that will help me be more efficient and help my work be more enjoyable. And I don’t plan on starting to use them all at once — over time I will pick and choose tools as I get excited about them or find the need for them.

您的文本编辑器可以为您做很多有趣的事情! 我敢肯定,我将继续学习一些工具,这些工具将帮助我提高工作效率,并使我的工作更有趣。 而且,我不打算立即开始全部使用它们-随着时间的流逝,当我对它们感到兴奋或发现需要它们时,我会选择各种工具。

Hopefully some of these tips & tricks were exciting or helpful to you! I’d love to hear in the comments about what sorts of text editor features you love to use. ?

希望这些提示和技巧对您有帮助或对您有所帮助! 我很乐意在评论中听到您喜欢使用哪种类型的文本编辑器功能。 ?

翻译自: https://www.freecodecamp.org/news/helping-your-text-editor-help-you-24ea08adc6a6/

gvim文本编辑器帮助

gvim文本编辑器帮助_如何帮助您的文本编辑器帮助您相关推荐

  1. python初学者用什么编辑器好_新人学 python 选什么编辑器比较好呢??

    点击上方蓝字关注我们 ↑关注 + 星标 ,每天学Python新技能 后台回复[大礼包]送你Python自学大礼! 新手学Python用什么编辑器比较好?工欲善其事必先利其器,选好工具学习更高效.市面上 ...

  2. 文本显示变量_无代码软件开发文本字符显示设计

    腾讯课堂搜"尚识"进行在线学习 无代码软件开发如果要显示一些文字在页面中,或者是表格中显示字符串字段值,都是拖放文本显示元件,然后将要显示的值传给显示元件中的"值&quo ...

  3. python tkinter text改变文本字体颜色_如何更改Tkinter中文本的颜色?

    在Tkinter图形用户界面中,我无法确定如何更改文本的颜色.我试着让Label1变成红色,Label2变成蓝色,Label3变成棕色,Label4变成黄色,但我似乎想不出来.提前谢谢:)import ...

  4. 论述类文本知识框架_高考语文“论述类文本阅读”:三步走,拿满分

    [原创首发] 新的学期开始了.高三的定位考试也结束了.成绩下来了,有的同学拿着卷子找着我:"老师,你看看,我第一道大题三道错了两道,咋办呀?"高考语文试卷的第一大道试题" ...

  5. java knn文本分类算法_使用KNN算法的文本分类.PDF

    使用KNN算法的文本分类.PDF 第31 卷 第8 期 计 算 机 工 程 2005 年4 月 Vol.31 8 Computer Engineering April 2005 人工智能及识别技术 文 ...

  6. 编辑器扩展_开发者必备,可扩展编辑器tui.editor和TOAST UI组件家族

    介绍 TOAST UI Editor是一个所见即所得的开源编辑器,GFM标准+图表和UML可扩展.它是我目前见过的功能最强大的开源MarkDown编辑器,具备强悍的生产力能力以及丰富的扩展性功能,总之 ...

  7. python以文本方式字节流_如何在Python3中将文本流编码为字节流?

    将字节流解码为文本流很容易: import io f = io.TextIOWrapper(io.BytesIO(b'Test\nTest\n'), 'utf-8') f.readline() 在这个 ...

  8. 齐博php百度编辑器上传图片_齐博CMS整合百度编辑器上传附件的BUG以及解决办法...

    齐博CMS作为目前PHP类CMS中最草根的CMS,能够及时的为站长们着想,将开源的百度编辑器整合进程序,这是值得广大站长欢呼雀跃的事情.但就目前来说,齐博CMS与百度编辑器的整合还是存在一些细小的问题 ...

  9. css 文本背景色透明_如何使用CSS将文本或图像的背景设置为透明?

    css 文本背景色透明 Introduction: 介绍: In web development, there are numerous ways by which we can style our ...

最新文章

  1. MangoDB使用总结
  2. weblogic调优的经过
  3. UVA10125和集
  4. 服务器中同一个【ip:port】可以多次accept的问题
  5. linux换源 最最简单
  6. 杰出数据科学家的关键技能是什么?
  7. Gradle 任务访问文件的几种方式
  8. python variable_PyTorch中的Variable变量详解
  9. java程序回滚之后在哪看_Java在触发事务回滚之后为什么会再一次回到Servlet开始的地方重新走一次流程?...
  10. python代码斜率_在Python中准确地测量代码执行时间
  11. 一顿操作猛如虎!云原生应用为何如此优秀?
  12. 分享小记:指数族分布
  13. Spring框架——day04参数校验和文件上传
  14. 移远EC20 4G模块拨号相关
  15. SQLserver2019找不到配置管理工具解决办法
  16. Ubuntu 18.04上使用snort3搭建NIDS(一)| 安装篇
  17. nginx 配置外网域名跳转到内网地址加端口的教程
  18. nsstring sizewithfont的崩溃
  19. Python中print函数细节——默认换行
  20. problem 1148

热门文章

  1. 2012届华为上机考试题目与参考答案
  2. 非空约束 mysql
  3. 接收用户的输入 Scanner类
  4. sublime编辑器下载与安装过程 2020
  5. openssh升级之后git账户免密登陆失效
  6. 我的AI之路 —— 从裸机搭建GPU版本的深度学习环境
  7. Linux进程管理与调度-之-目录导航【转】
  8. 结对编程 - 马尔科夫链
  9. DevExpress v15.1:CodeRush控件功能增强
  10. shell 脚本编程的10 个最佳实践