如何在 Atom 编辑器中自动缩进代码? [英] How to auto-indent code in the Atom editor?

查看:49
本文介绍了如何在 Atom 编辑器中自动缩进代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 Atom 编辑器中自动缩进代码?在其他编辑器中,您通常可以选择一些代码并自动缩进.

How do you auto-indent your code in the Atom editor? In other editors you can usually select some code and auto-indent it.

是否也有键盘快捷键?

推荐答案

我在菜单中找到了该选项,位于编辑">行">自动缩进"下.它似乎没有默认的键盘映射绑定.

I found the option in the menu, under Edit > Lines > Auto Indent. It doesn't seem to have a default keymap bound.

您可以尝试添加一个键映射(Atom > 打开您的键盘映射 [在 Windows 上:文件 > 设置 > 键绑定 > 您的键盘映射文件"]),如下所示:

You could try to add a key mapping (Atom > Open Your Keymap [on Windows: File > Settings > Keybindings > "your keymap file"]) like this one:

'atom-text-editor':
  'cmd-alt-l': 'editor:auto-indent'

它对我有用:)

对于 Windows:

For Windows:

'atom-text-editor':
  'ctrl-alt-l': 'editor:auto-indent'

这篇关于如何在 Atom 编辑器中自动缩进代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆