如何在自动完成时自动输入括号? [英] How to automatically enter brackets on autocomplete?
本文介绍了如何在自动完成时自动输入括号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
每当我为原子使用自动完成功能时,它都不包含方括号.例如,如果我开始输入打印",则按回车键,然后输入打印但不包括方括号.
Whenever I use the autocomplete for atom it doesn't include the brackets. For example if i start typing "print" I hit enter and it enters print but doesn't include the brackets.
推荐答案
默认 Python片段仅支持print
关键字,不支持print()
函数.由于我还没有找到能做到这一点的软件包,因此最好添加以下代码段(Atom>打开您的代码段),例如:
The default Python snippets only supports the print
keyword, not the print()
function. Since I haven't found another package that does, you're problably best off adding a snippet (Atom > Open Your Snippets) such as:
'.source.python':
'print()':
'prefix': 'print-function'
'body': 'print($1)'
该前缀将触发主体中定义的代码段,以防更喜欢以其他方式调用它.
The prefix will trigger the snippet defined in the body, in case prefer to call it differently.
这篇关于如何在自动完成时自动输入括号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文