当前位置:网站首页>复制的代码格式混乱怎么办?
复制的代码格式混乱怎么办?
2022-06-11 08:33:00 【macwbear】
你是否遇到过随手粘贴复制的代码格式混乱的问题?如果不关注代码的格式随手一粘,别人看到的画风就可能是这样:

那么,如何才能快速且优雅的分享代码片段呢?
Raycast + ray.so 是一个值得一试的方案。
什么是Raycast
Raycast 是一款速度极快、完全可扩展的启动器。它可以让你完成任务、计算、共享公共链接等等。
Raycast 与传统 Launcher,如 Alfred 和 LaunchBar 相比,最大的优势可能在于其完全免费。
简而言之,通过 Raycast 你可以快速的执行很多你需要的任务,在今天的文章中,Raycast 主要起到触发器的作用,帮助我们快速执行生成代码图片的任务。

什么是ray.so
从名字就可以看出,ray.so 和 Raycast 二者师出同门,是一款提供代码图片分享的 Web 服务,可以将代码文本转化为美观的图片进行分享。
与此同时,ray.so 也提供了很多可共配置的自定义项,可以定制出你喜好的图片风格。
类似的 Web 服务还有 Carbon 等。

1 + 1 > 2
从上面的介绍就可以看出,Raycast 和 ray.so 都有大量竞品,各自的体验上来说也绝非独一无二,这对组合最大的亮点就是他们能无缝结合,提供『一步到位』的效果。
准备工作
- 安装 Raycast
- 安装 ray.so 插件
首先通过快捷键呼出 Raycast 命令输入框,并输入 store,找到 Raycast 内建的插件商店。

回车进入插件商店,并直接输入ray.so搜索,再次执行回车安装。

至此准备工作就已经完成,接下来就可以找一段代码尝试一下了。
从代码到图片,总共分几步
在 Raycast + ray.so 组合里,答案是 2 步
选中代码,这里以编辑器中的一段 JSON 代码为例,ray.so 会自动侦测代码语言,并赋予其合适的高亮风格。

CMD + 空格(呼出 Raycast),并输入 CI(Copy Image 的首字母)回车。

稍等几秒后,一张生成好的代码图片就已经拷贝到你的剪贴板了,你可以视其用途粘贴到需要的地方。

定制化
如果对默认生成的图片风格不满意,ray.so 插件也提供了可供客制化的命令。
这次我们尝试使用 Create Image from Code 命令:

命令执行后我们会看到一个二级面板,我们可以在这里定制生成图片的风格,具体配置项如下图:

完成配置后,点击右下角的Create Snippet即可将图片拷贝到剪贴板。
边栏推荐
- Introduction to guava cache usage
- Solve ('You must install pydot (`pip install pydot`) and install graphviz (see...) '‘ for plot_ model..
- SSM file upload and download
- 堆是也可以看成一种树结构,规定根节点必须大于或小于左右子节点,但左右子节点的大小顺序没有规定
- Zookepper===> animal management system
- Uniapp turn off / on / adjust system sound
- 标准化编写知识
- Implementation of CRF for named entity recognition
- centos随笔03:centos8.2安装mysql
- Reference implementation scheme of database database and table division strategy
猜你喜欢

leetcode - 460. LFU 缓存

Qiao NPMS: get the download volume of NPM packages

What is concurrent search set? Are you still worried about it? In fact, it is a problem of connected graph, which is not so difficult to understand

Node error report sorting

深度学习入门之pytorch安装

Award winning survey | how Apache pulsar lived in 2022, you the final say

qiao-npms:获取npm包下载量

Zipkin入门

Oracle learning (I)

指定环境下安装Jupyter
随机推荐
Idea pulls items from remote warehouse
Introduction to database system experiment report answer Experiment 6: advanced query of data table
Using flying items to manage by objectives, not being a "headless fly" in the workplace
Uniapp turn off / on / adjust system sound
Swagger study notes
Entity class conversion cannot be reassigned
leetcode - 518. 零钱兑换 II
一些学习记录i=
Redis6 entry-level tutorial. There are integration cases. You can directly see the integration cases. It is easy to get started
Heap can also be regarded as a tree structure. It is specified that the root node must be greater than or less than the left and right child nodes, but the size order of the left and right child nodes
Type of SQL command (incomplete)
torch. nn. functional. pad
剑指 Offer 51. 数组中的逆序对
B+超强树,带你知晓MySQL的底层是怎样的结构
ICML2022有意思的文章
for in / for of / forEach 循环
深度学习入门之pytorch安装
这几个小工具也太好用了
Codetop - sort odd ascending even descending linked list
Award winning survey | how Apache pulsar lived in 2022, you the final say