当前位置:网站首页>复制的代码格式混乱怎么办?
复制的代码格式混乱怎么办?
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即可将图片拷贝到剪贴板。
边栏推荐
- Interprocess communication
- 剑指 Offer 10- II. 青蛙跳台阶问题
- Don't want the project out of control? You need to use project management tools
- Difference between threadpooltaskexecutor and ThreadPoolExecutor
- Anaconda+tensorflow most effective summary version (blood and tears summary of 6 reloads)
- Use Jackson's @jsonproperty annotation to add one more field to the property name. Solution to the problem
- (resolved) typeerror: meshgrid() got an unexpected keyword argument 'indexing‘
- leetcode - 739. 每日温度
- 【clickhouse专栏】新建库角色用户初始化
- Solve cannot import name 'multiheadattention' from 'tensorflow keras. layers‘
猜你喜欢

torch. Var (), sample variance, parent variance

结果和目标出入太大?不妨借助目标管理精准直达目标!

leetcode - 230. 二叉搜索树中第K小的元素

Matlab学习9-图像处理之非线性锐化滤波

MySQL advanced features, you can read more about it and meet the interview

Is the result too different from the goal? With the help of target management, you can reach the target accurately!

Empty difference between postgrepsql and Oracle

node报错整理

uniapp 插件开发

B+ super tree helps you know the underlying structure of MySQL
随机推荐
Entity class conversion cannot be reassigned
AttributeError: module ‘tensorflow. compat. v2.__ internal__‘ has no attribute ‘register_ clear_ session_
leetcode - 739. 每日温度
How to do a good job in project management? Learning these four steps is enough
补2:圆环回原点问题
(completely solved) dataframe assignment settingwithcopywarning: a value is trying to be set on a copy of a slice
Solve cannot import name 'multiheadattention' from 'tensorflow keras. layers‘
(resolved) the tqdm progress bar in the Jupiter notebook does not update and display in one line, but scrolls down to output
leetcode - 230. 二叉搜索树中第K小的元素
Zookepper===>动物管理员系统
(taking pytorch as an example) a simple understanding of the regularization method of path (depth) -drop path
Multiple limit of the same field of SQL
[software tool] the hacker matrix special effect software CMatrix
Pg/oracle database ASCII code to string custom function
Modulenotfounderror: no module named 'tensorboard in pytorch‘
Using flying items to manage by objectives, not being a "headless fly" in the workplace
Standardized compilation knowledge
Supplementary provision plan codeworks round 760 (Div. 3)
【clickhouse专栏】新建库角色用户初始化
项目实训-克隆门